From 7c267c3fea4c36aab8d68580c004ac084cca0077 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Thu, 26 Oct 2017 19:46:57 -0300 Subject: [PATCH] Change order of validations in travis script --- .travis/common.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) 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)