Skip to content

Commit

Permalink
Only upload to docker hub on master branch (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
black-adder authored Apr 11, 2017
1 parent c412384 commit 899c1b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ env:
# DOCKER_USER
- secure: TNvbr5/d7raSovEtttxdrZl8tP7vCCzL56gKKhr2wF4ET5/iRbcfSP9zoFPEOlIdgmCHZhGTh+fED1Eqgyswv6HPOAfEuov5vtzNB9fkcI46/nRk7KbiDlcEuE2IFtwkijFDz6YdJlbPCozHa81/Ih6G20H61tgv6f0AsGGT9MR7DQ71cCu8xZykNDjEKTo7RF6GiqG2VYa+S1P3vCOKRv31ouo/a5SPP+1AIvAg8u++qWVC8WJixmkXnw2OplvCFgHS0dlT3FvUPjYtUtLens5gpBDo7kn7+Ba27m2D0IzkzDPW5sK0YMMZW61LLn8GLPiJtLqzUHovaJ2NcFfi07RQ4GSMnwnjP0nLQbgd0CzM2zJGJRcOTkYe7IEDrdcTBcljZdZAJdoJEzrGYYWRQcX0Kyjc83ghX3A5s+CQWlPElQrkBB7KhNZ+w2Cn4+Mr6zOiRnBYg1NIUV2eGHMNnC4HI9RqgvA1QqcT5YHWqpz20sddHx1kgzgh8vOW8csiFon/Wrvyb2TaemzsKxIlT/UZZfDuyWG/Lvm4oxmTp1GrgQsC2iJjox4z6VIxbhykZEqNU1dhY6KuvgjEGetxk2j/NVfI8Qb4tvWqKoXq5Buap/J0AWjxWjGbrIGZbz5FgzfEP33WR8X2Oh5Cy+TMl1v0+YBAB3OaMpe/Qe2rGlk= # DOCKER_PASS
# DOCKER_PASS
- secure: mX3/Gwv5esCjU9GfqDaXbTslA0UOY9q45+rnW58X6z1tY2pFOts5uhtLve3YneGn3IN0n+m5mcljim72vKNQaPJCSodYfcfrqth2YqkYTXNWykOIdlLs1u58pYYGRXJaAlD4EgQysB/nAaQ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RiXgeN9DkFw/TuBIV3CMHi6sbgiNIv15CLO0ZGlUJnF+q4u5o9qUT/XSykNn0+Z/2ABMIJvS496gU3OT7RbjmuZforqyvCniMow4hDiE8MtZMBYOSmM1CiHQb413/kPgUjYQ2ajnuU=

install:
- nvm use 4
Expand Down
7 changes: 5 additions & 2 deletions travis/build-all-in-one-image.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -ex
set -e

export REPO=jaegertracing/all-in-one
export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
Expand All @@ -10,9 +10,12 @@ echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, REPO=$REPO, PR=$PR, BRANCH=$BRANCH, TAG=$TAG
make build-all-in-one-linux

# Only push the docker container to Docker Hub for master branch
if [[ "$TRAVIS_PULL_REQUEST" == "false" || "$BRANCH" == "master" ]]; then echo 'upload to Docker Hub'; else echo 'skip docker upload for PR'; exit 0; fi
if [ "$BRANCH" == "master" ]; then echo 'upload to Docker Hub'; else echo 'skip docker upload for PR'; exit 0; fi

docker login -u $DOCKER_USER -p $DOCKER_PASS

set -x

docker build -f cmd/standalone/Dockerfile -t $REPO:$COMMIT .
docker tag $REPO:$COMMIT $REPO:$TAG
docker tag $REPO:$COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER
Expand Down

0 comments on commit 899c1b8

Please sign in to comment.