Skip to content

Commit

Permalink
Merge pull request #45 from bzub/image-per-commit
Browse files Browse the repository at this point in the history
TravisCI: Image tag for commits, releases tagged latest, others tagge…
  • Loading branch information
murali-reddy committed Jul 7, 2017
2 parents e5b47ed + 0a939b8 commit e0c2f7c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ go:
- 1.7.x

after_success:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push cloudnativelabs/kube-router;
fi
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
- export REPO=cloudnativelabs/kube-router;
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "master"; else echo $TRAVIS_BRANCH ; fi`
- docker build -f Dockerfile -t $REPO:$COMMIT .
- docker tag $REPO:$COMMIT $REPO:$TAG
- if [ ! -z ${TRAVIS_TAG+x} ]; then
docker tag $REPO:$COMMIT $REPO:$TRAVIS_TAG;
docker tag $REPO:$COMMIT $REPO:latest;
fi
- docker push $REPO

script:
- make all

0 comments on commit e0c2f7c

Please sign in to comment.