diff --git a/docker_build.sh b/docker_build.sh old mode 100644 new mode 100755 diff --git a/docker_push.sh b/docker_push.sh old mode 100644 new mode 100755 index 71650bd..2f0c650 --- a/docker_push.sh +++ b/docker_push.sh @@ -12,8 +12,8 @@ docker_push(){ # TRAVIS_TAG: If the current build is for a git tag, this variable is set to the tag’s name. # TRAVIS_PULL_REQUEST_BRANCH: if the current job is a pull request, the name of the branch from which the PR originated. -if [[ "$TRAVIS_PULL_REQUEST_BRANCH" == "" ]]; then - if [[ "$TRAVIS_TAG" =! "" ]]; then +if [[ -z "$TRAVIS_PULL_REQUEST_BRANCH" ]]; then + if [[ -n "$TRAVIS_TAG" ]]; then # Tagging should trigger a release in Docker Hub, that's immutable. echo "git tag action, push the tag" docker_push "$TRAVIS_TAG-release" @@ -21,7 +21,7 @@ if [[ "$TRAVIS_PULL_REQUEST_BRANCH" == "" ]]; then # we push to latest when master is built and that's not a pull request echo "master build, push to latest" docker_push "latest" - elif [[ "$TRAVIS_BRANCH" ~= "v*" ]]; then + elif [[ "$TRAVIS_BRANCH" == "v"* ]]; then # this is a version branch and we push it. echo "branch build, push to branch-latest" docker_push "$TRAVIS_BRANCH-latest"