Compare commits

..

3 Commits

View File

@ -23,7 +23,7 @@ else
if [[ $TRAVIS_BRANCH == master ]] || [[ $TRAVIS_BRANCH == "$VERSION" ]]; then if [[ $TRAVIS_BRANCH == master ]] || [[ $TRAVIS_BRANCH == "$VERSION" ]]; then
TAGS="$DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT" TAGS="$DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
# we are on an incremental build of a tag # we are on an incremental build of a tag
elif [[ $TRAVIS_BRANCH == "${VERSION%-*}" ]]; then elif [[ $VERSION == "${TRAVIS_BRANCH%-*}" ]]; then
TAGS="$DOCKER_REPO:$TRAVIS_BRANCH -t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT" TAGS="$DOCKER_REPO:$TRAVIS_BRANCH -t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
# we build a other branch than master # we build a other branch than master
elif [[ -n $TRAVIS_BRANCH ]]; then elif [[ -n $TRAVIS_BRANCH ]]; then
@ -46,7 +46,7 @@ docker images
# latest changes where made in the folder corosponding to the version we build, we are on master and don#t build a PR. # latest changes where made in the folder corosponding to the version we build, we are on master and don#t build a PR.
if [[ $(dirname "$(git diff --name-only HEAD^)") =~ $VERSION_SHORT ]] && [[ $TRAVIS_BRANCH == master ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] || if [[ $(dirname "$(git diff --name-only HEAD^)") =~ $VERSION_SHORT ]] && [[ $TRAVIS_BRANCH == master ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] ||
# we build a tag and we are not on master # we build a tag and we are not on master
[[ $TRAVIS_BRANCH == "${VERSION%-*}" ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] || [[ $VERSION == "${TRAVIS_BRANCH%-*}" ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] ||
# we are not in CI # we are not in CI
[[ $CI == "" ]]; then [[ $CI == "" ]]; then
@ -55,12 +55,12 @@ if [[ $(dirname "$(git diff --name-only HEAD^)") =~ $VERSION_SHORT ]] && [[ $TRA
fi fi
# push a tag on a branch other than master # push a tag on a branch other than master
if [[ -n $TRAVIS_BRANCH ]] && [[ $TRAVIS_BRANCH != "${VERSION%-*}" ]] && [[ $TRAVIS_BRANCH != "master" ]]; then if [[ -n $TRAVIS_BRANCH ]] && [[ $VERSION != "${TRAVIS_BRANCH%-*}" ]] && [[ $TRAVIS_BRANCH != "master" ]]; then
docker push "$DOCKER_REPO:$TRAVIS_BRANCH" docker push "$DOCKER_REPO:$TRAVIS_BRANCH"
fi fi
# push an incremental tag # push an incremental tag
if [[ $TRAVIS_BRANCH != "${VERSION%-*}" ]]; then if [[ $VERSION == "${TRAVIS_BRANCH%-*}" ]]; then
docker push "$DOCKER_REPO:$TRAVIS_BRANCH" docker push "$DOCKER_REPO:$TRAVIS_BRANCH"
fi fi