Skip to content

Commit

Permalink
use buildstamp in docker and correct its instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Feb 27, 2018
1 parent c0e2b12 commit 2b1dd65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ See [instructions](./docker/README.md)

Note the required `-tags rethinkdb` build option.

You may also optionally define `main.buildstamp` for the server by adding a build option
You may also optionally define `main.buildstamp` for the server by adding a build option, for instance, with a timestamp:
```
-X main.buildstamp=`date -u '+%Y%m%dT%H:%M:%SZ'`
-ldflags "-X main.buildstamp=`date -u '+%Y%m%dT%H:%M:%SZ'`"
```
This build timestamp will be sent by the server to the clients.
The value of `buildstamp` will be sent by the server to the clients.

- Download javascript client for testing:
- https://github.com/tinode/example-react-js/archive/master.zip
Expand Down
3 changes: 2 additions & 1 deletion docker/tinode-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ ENV TARGET_DB=$TARGET_DB

# Build the binary.
RUN go get -tags $TARGET_DB github.com/tinode/chat/server \
&& go install -tags $TARGET_DB github.com/tinode/chat/server
&& go install -tags $TARGET_DB -ldflags "-X main.buildstamp=${TARGET_DB}-`date -u '+%Y%m%dT%H:%M:%SZ'`" \
github.com/tinode/chat/server

# Download the demo app and the js bindings
RUN git clone --depth 1 https://github.com/tinode/example-react-js.git
Expand Down

0 comments on commit 2b1dd65

Please sign in to comment.