diff --git a/.travis/common.sh b/.travis/common.sh index a20ab43fa..f2047ed5f 100755 --- a/.travis/common.sh +++ b/.travis/common.sh @@ -34,19 +34,6 @@ then exit 0; fi -# variables QUAY_USERNAME and QUAY_PASSWORD are required to push docker images -if [ "$QUAY_USERNAME" == "" ]; -then - echo "Environment variable QUAY_USERNAME is missing."; - exit 0; -fi - -if [ "$QUAY_PASSWORD" == "" ]; -then - echo "Environment variable QUAY_PASSWORD is missing."; - exit 0; -fi - SKIP_MESSAGE="Publication of docker image to quay.io registry skipped." if [ "$TRAVIS_EVENT_TYPE" != "api" ]; @@ -67,6 +54,19 @@ then exit 0; fi +# variables QUAY_USERNAME and QUAY_PASSWORD are required to push docker images +if [ "$QUAY_USERNAME" == "" ]; +then + echo "Environment variable QUAY_USERNAME is missing."; + exit 0; +fi + +if [ "$QUAY_PASSWORD" == "" ]; +then + echo "Environment variable QUAY_PASSWORD is missing."; + exit 0; +fi + function docker_tag_exists() { TAG=${2//\"/} IMAGES=$(curl -s -H "Authorization: Bearer ${QUAY_PASSWORD}" https://quay.io/api/v1/repository/$1/image/ | jq '.images | sort_by(.sort_index) | .[] .tags | select(.[] !=null) | .[0]' | sed s/\"//g)