Skip to content

Commit

Permalink
Fix travis build script where wrong production branch value were used
Browse files Browse the repository at this point in the history
  • Loading branch information
Pesonet1 authored Oct 19, 2020
2 parents aa9264f + 62aca9a commit 058d708
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions travis-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ echo "Building image with tag -> ${DOCKER_TAG}"
docker build --tag=$DOCKER_IMAGE .

if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then
if [[ " ${BUILD_AND_PUSH_BRANCHES[*]} " == *"$DOCKER_TAG"* ]]; then
if [[ " ${BUILD_AND_PUSH_BRANCHES[*]} " == *"$TRAVIS_BRANCH"* ]]; then
echo "Pushing builded image to registry with tag -> ${DOCKER_TAG}"

docker login -u $DOCKER_USER -p $DOCKER_AUTH
docker push $DOCKER_IMAGE
else
echo "Pushed branch is not targeted environment branch (development, stage, production). Image is not pushed to registry"
echo "Pushed branch is not targeted environment branch (development, stage, master). Image is not pushed to registry"
fi
else
echo "Image is not pushed to registry for pull requests"
Expand Down

0 comments on commit 058d708

Please sign in to comment.