Skip to content

Commit

Permalink
TravisCI: Image tag for commits, releases tagged latest, others tagge…
Browse files Browse the repository at this point in the history
…d master
  • Loading branch information
bzub committed Jul 7, 2017
1 parent e5b47ed commit 0a939b8
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 0a939b8

Please sign in to comment.