Merge pull request #1153 from influxdb/add_versioning

Add instructions on how to set branch and commit hash
pull/1157/head
Philip O'Toole 2014-11-22 16:30:15 -08:00
commit b60e6ecca9
1 changed files with 8 additions and 2 deletions

View File

@ -58,7 +58,7 @@ the following to format the code:
Build and Test
-----
Make sure you have Go installed. To build the project, execute the following commands
Make sure you have Go installed. To build the project, execute the following commands:
```bash
cd $GOPATH/src/github.com/influxdb
@ -66,7 +66,13 @@ go get -u ./...
go build ./...
```
Once compilation completes, the binaries can be found in `$GOPATH/bin`.
Once compilation completes, the binaries can be found in `$GOPATH/bin`. To set the version and commit flags pass the following to the build command:
```bash
-ldflags="-X main.version $VERSION -X main.commit $COMMIT"
```
where $VERSION is the version, and $COMMIT is the git commit hash.
To run the tests, execute the following command: