traefik/circle.yml
2015-09-14 14:42:53 +02:00

30 lines
875 B
YAML

machine:
services:
- docker
environment:
REPO: $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
dependencies:
pre:
- go generate
- CGO_ENABLED=0 go build -a -installsuffix nocgo .
- go get github.com/mitchellh/gox
- go get github.com/tcnksm/ghr
- gox -verbose -os "linux darwin windows" --output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}"
override:
- echo $REPO
- docker build -t ${REPO,,} .
deployment:
github:
branch: master
commands:
- ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --prerelease --replace `git describe --tags` dist/
dockerhub:
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