gunjan5 | 6e19d27 | 2016-07-07 14:23:26 -0700 | [diff] [blame] | 1 | |
| 2 | default: image |
| 3 | |
| 4 | ansible: |
| 5 | ansible-playbook ./setup.yml -v -vvvv -u gunjan -i ./host.yml --ask-pass |
| 6 | |
| 7 | get: |
| 8 | goimports -w . |
| 9 | go get -t -d -v ./... |
| 10 | |
| 11 | src: |
| 12 | docker run --rm -it -v "$GOPATH":/gopath -v "$(pwd)":/app -e "GOPATH=/gopath" -w /app golang:1.6.1 sh -c 'CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o app' |
| 13 | |
| 14 | fmt: |
| 15 | gofmt -w . |
| 16 | #TODO: go lint, go vet |
| 17 | test: |
| 18 | go test -v -race ./... |
| 19 | go test -cover -v ./... |
| 20 | |
| 21 | image: |
gunjan5 | d6ca177 | 2016-07-20 18:11:04 -0700 | [diff] [blame] | 22 | docker build -t config-gen . |
gunjan5 | 6e19d27 | 2016-07-07 14:23:26 -0700 | [diff] [blame] | 23 | |
| 24 | run: |
gunjan5 | d6ca177 | 2016-07-20 18:11:04 -0700 | [diff] [blame] | 25 | docker run --rm -p 1337:1337 -it config-gen |
gunjan5 | 6e19d27 | 2016-07-07 14:23:26 -0700 | [diff] [blame] | 26 | |
| 27 | build: |
| 28 | GOOS=linux GOARCH=amd64 go build -o app |
| 29 | |
| 30 | depsave: |
| 31 | godep save |
| 32 | |
| 33 | depupdate: |
| 34 | go get -t -v ./... |
| 35 | godep update |