sudo: required

tags: true

services:
- docker

script:
- docker run --rm -v "$PWD":/go/src/github.com/ApsOps/gohaqd -w /go/src/github.com/ApsOps/gohaqd -e 'CGO_ENABLED=0' -e 'GOOS=linux' golang:1.7 /bin/bash -c "go build -a -v -ldflags '-w'"

after_success:
- export REPO=apsops/gohaqd
- export TAG=${TRAVIS_TAG:=latest}
- docker build -t $REPO:$TRAVIS_COMMIT .
- docker tag $REPO:$TRAVIS_COMMIT $REPO:$TAG
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker push $REPO


sudo: required

tags: true

services:
- docker

script:
- docker run --rm -v "$PWD":/go/src/github.com/ApsOps/gohaqd -w /go/src/github.com/ApsOps/gohaqd -e 'CGO_ENABLED=0' -e 'GOOS=linux' golang:1.7 /bin/bash -c "go build -a -v -ldflags '-w'"

after_success:
- export REPO=apsops/gohaqd
- export TAG=${TRAVIS_TAG:=latest}
- docker build -t $REPO:$TAG .
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker push $REPO


Build only git tags and latest docker images
Build only git tags and latest docker images
