2015-09-14 09:28:33 +00:00
|
|
|
machine:
|
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
environment:
|
|
|
|
REPO: $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
|
|
|
|
|
|
|
|
dependencies:
|
|
|
|
pre:
|
2015-09-14 09:30:15 +00:00
|
|
|
- go generate
|
2015-09-14 09:28:33 +00:00
|
|
|
- CGO_ENABLED=0 go build -a -installsuffix nocgo .
|
2015-09-14 11:42:59 +00:00
|
|
|
- go get github.com/mitchellh/gox
|
|
|
|
- go get github.com/tcnksm/ghr
|
2015-09-14 12:42:53 +00:00
|
|
|
- gox -verbose -os "linux darwin windows" --output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}"
|
2015-09-14 11:42:59 +00:00
|
|
|
|
2015-09-14 09:28:33 +00:00
|
|
|
override:
|
|
|
|
- echo $REPO
|
|
|
|
- docker build -t ${REPO,,} .
|
|
|
|
|
|
|
|
deployment:
|
2015-09-14 11:42:59 +00:00
|
|
|
github:
|
|
|
|
branch: master
|
|
|
|
commands:
|
2015-09-14 22:03:53 +00:00
|
|
|
- ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --prerelease --replace `git describe --tags --abbrev=0` dist/
|
2015-09-14 11:42:59 +00:00
|
|
|
dockerhub:
|
2015-09-14 09:28:33 +00:00
|
|
|
branch: master
|
|
|
|
commands:
|
|
|
|
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
|
|
|
|
- docker push ${REPO,,}:latest
|
|
|
|
- docker tag ${REPO,,}:latest ${REPO,,}:$CIRCLE_SHA1
|
|
|
|
- docker push ${REPO,,}:$CIRCLE_SHA1
|