Skip to content

Commit

Permalink
Merge pull request chrislusf#29 from alpe/push_to_docker_hub
Browse files Browse the repository at this point in the history
[WIP] Push to docker hub
  • Loading branch information
chrislusf committed Feb 14, 2016
2 parents 5c58a23 + 8bcbbd4 commit 53cb28e
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sudo: false
sudo: required
os:
- linux
- osx
Expand All @@ -10,16 +10,29 @@ go:
- 1.5
- tip

services:
- docker

env:
- GOMAXPROCS=4 GORACE="halt_on_error=1"
- DOCKER_REPO=alpetest/glow

before_install:
- export PATH=/home/travis/gopath/bin:$PATH
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install bzr ; fi

install:
- go get ./...

script:
- go test -race -timeout=90s ./...
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build .
- docker build -f Dockerfile -t $DOCKER_REPO:$COMMIT .

env:
- GOMAXPROCS=4 GORACE="halt_on_error=1"
after_success:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "$TRAVIS_BRANCH" ; fi`
- docker tag $DOCKER_REPO:$COMMIT $DOCKER_REPO:$TAG
- docker tag $DOCKER_REPO:$COMMIT $DOCKER_REPO:travis-$TRAVIS_BUILD_NUMBER
- if [["$TRAVIS_GO_VERSION" == "1.5"]] && [["$TRAVIS_OS_NAME" == "linux"]]; then docker push $DOCKER_REPO ;fi

0 comments on commit 53cb28e

Please sign in to comment.