diff --git a/.travis.yml b/.travis.yml index 38ad4b6e..58af8a03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,5 +16,4 @@ cache: after_success: - bash <(curl -s https://codecov.io/bash) - ./gradlew shadowJar --daemon || travis_terminate 1 - - ./gradlew dockerPushImage -Dbuild.version=$TRAVIS_COMMIT --daemon || travis_terminate 1 - - ./gradlew dockerPushImage -Dbuild.version=$TRAVIS_BRANCH --daemon || travis_terminate 1 + - ./docker-push.sh diff --git a/docker-push.sh b/docker-push.sh new file mode 100755 index 00000000..e8299892 --- /dev/null +++ b/docker-push.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +if [[ $TRAVIS_BRANCH = "master" ]] +then + ./gradlew dockerPushImage -Dbuild.version=latest --daemon || travis_terminate 1 +fi +if ! [[ -z $TRAVIS_TAG ]] +then + ./gradlew dockerPushImage -Dbuild.version=$TRAVIS_TAG --daemon || travis_terminate 1 +fi \ No newline at end of file