Build
$ GOPATH=$PWD go build sidekick
Build with go
-
SET (GOARCH,GOOS) to (amd64,linux) for linux and (GOARCH,GOOS) to (amd64,windows) for windows. You can:
-
either run
- go install -a github.com/voyages-sncf-technologies/strowgr-sidekick/cmd/sidekick.
- The executable is at $GOPATH/bin or $GOPATH/bin/$GOOS_$GOARCH and is named strowgr_sidekick.
-
At root of your project:
- go build -o sidekick
- The executable is at the root of the project and is named sidekick.
$ ./sidekick -version Version: 0.2.3-SNAPSHOT Build date: 2016-12-01T22:18:43Z GitCommit: 290f97d GitBranch: nomaven GitState: dirty
# Build with docker container
```bash
docker build -f Dockerfile.build -t strowgr/sidekick-builder:$(cat VERSION) .
docker run -v $PWD:/go -v $PWD:/bin strowgr/sidekick-builder:$(cat VERSION)
Binary is generated here: ./sidekick
.
Build docker image with haproxy instances
docker build -t strowgr/sidekick:$(cat VERSION) .
Run
$ ./sidekick -h
Usage of ./sidekick:
-config string
Configuration file (default "sidekick.conf")
-fake string
Force response without reload for testing purpose. 'yesman': always say ok, 'drunk': random status/errors for entrypoint updates. Just for test purpose.
-generate-config
generate a default config file to the standard output
-log-compact
compacting log format
-mono
only one haproxy instance which play slave/master roles.
-verbose
Log in verbose mode
-version
Print current version
Release
Git standard way ==> https://git-scm.com/book/en/v2/Git-Basics-Tagging
Local Desk Installation.
- Prequisite: Install go if not present.
- Set GOROOT the installation folder.
- add GOROOT/bin to PATH.
- If no existing workspace, create one (== Empty Directory).
- Set GOPATH to this workspace.
- ADD GOPATH/bin to PATH
- If not present, get go dep: go get -u -v github.com/golang/dep/cmd/dep
- dep executable is installed at GOPATH/bin
- Get the projet: run: go get -v github.com/voyages-sncf-technologies/strowgr-sidekick.
- Go to the project at GOPATH/src/github.com/voyages-sncf-technologies/strowgr-sidekick.
- Install dependencies, run: dep ensure to install dependencies (vendor sub folder created).
- To build a native executable:
- run go install -a github.com/voyages-sncf-technologies/strowgr-sidekick/cmd/sidekick. sidekick executable will be installed in GOPATH/bin, so in the PATH.
- At root of the project only, you can also run:
- For windows user: go build -o sidekick.exe sidekick executable will be installed in GOPATH/bin
- For linux user: go build -o sidekick executable will be installed in GOPATH/bin.
- You can arbitraly choose the value for -o option, but need .exe extension for windows run.
- To build a docker image in local desk
- the executable you build has to be embedded in docker linux image, so you will have to change GOOS to linux if necessary (and reset it after)
- WARN: in windows command line, the window could close after executing, so you can run: start go get -u -v github.com/golang/dep/cmd/dep