Skip to content

Commit

Permalink
Fix travis tag docker push (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
orkunkl authored Apr 29, 2020
1 parent 805176b commit 583e390
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@ script:
- unset TRAVIS_COMMIT_MESSAGE && printenv | grep -Ev "PATH|path|GEM" > env.list
- export TRAVIS_COMMIT_MESSAGE=`cat commit.msg` && rm -rf commit.msg
- if [[ "$TRAVIS_GO_VERSION" == "$MAIN_GO_VERSION" && "$TRAVIS_OS_NAME" == "linux" ]]; then
release_latest=$( [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_TAG" == "" && "$TRAVIS_PULL_REQUEST_BRANCH" == "" ]] && echo "yes" || echo "no" );
release_tag=$( [[ "$TRAVIS_TAG" != "" ]] && echo "yes" || echo "no" );

if [[ $release_latest == "yes" || $release_tag == "yes" ]]; then
make build
docker build --pull --tag ${IMAGE_NAME} . ;
fi;

if [[ $release_latest == "yes" ]]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
docker tag "iov1/iovns:${BUILD_VERSION}" "iov1/iovns:latest" ;
docker push "iov1/iovns:latest";
docker logout;
fi;

if [[ $release_tag == "yes" ]]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
docker tag "iov1/iovns:${BUILD_VERSION}" "iov1/iovns:$TRAVIS_TAG" ;
docker push "iov1/iovns:$TRAVIS_TAG";
docker logout;
fi;
release_latest=$( [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_TAG" == "" && "$TRAVIS_PULL_REQUEST_BRANCH" == "" ]] && echo "yes" || echo "no" );
release_tag=$( [[ "$TRAVIS_TAG" != "" ]] && echo "yes" || echo "no" );

if [[ $release_latest == "yes" || $release_tag == "yes" ]]; then
make build;
docker build --pull --tag ${IMAGE_NAME} . ;
fi;

if [[ $release_latest == "yes" ]]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
docker tag "iov1/iovns:${BUILD_VERSION}" "iov1/iovns:latest" ;
docker push "iov1/iovns:latest";
docker logout;
fi;

if [[ $release_tag == "yes" ]]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
docker tag "iov1/iovns:${BUILD_VERSION}" "iov1/iovns:$TRAVIS_TAG" ;
docker push "iov1/iovns:$TRAVIS_TAG";
docker logout;
fi;
fi;

0 comments on commit 583e390

Please sign in to comment.