Skip to content

Commit

Permalink
Let the build push to Docker Hub for TAGs
Browse files Browse the repository at this point in the history
  • Loading branch information
scholzj committed Nov 7, 2017
1 parent 4fd759a commit e151819
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ set -e

export PULL_REQUEST=${PULL_REQUEST:-true}
export BRANCH=${BRANCH:-master}
export TAG=${TAG:-latest}
export DOCKER_ORG=${DOCKER_ORG:-$USER}
export DOCKER_REGISTRY=${DOCKER_REGISTRY:-docker.io}
export DOCKER_TAG=${TAG:-latest}
export DOCKER_TAG=$TAG
export DOCKER_VERSION_ARG=${COMMIT:-latest}

make docker_build

if [ "$PULL_REQUEST" != "false" ] || [ "$BRANCH" != "master" ] ; then
echo "Building Pull Request or side branch - nothing to push"
if [ "$PULL_REQUEST" != "false" ]; then
echo "Building Pull Request - nothing to push"
elif [ "$TAG" == "latest" ] && [ "$BRANCH" != "master" ]; then
echo "Not in master branch and not in release tag - nothing to push"
else
echo "Login into Docker Hub ..."
docker login -u $DOCKER_USER -p $DOCKER_PASS
Expand Down

0 comments on commit e151819

Please sign in to comment.