Merge pull request #1606 from aledbf/change-order

Change order of validations in travis script [ci skip]
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-10-26 19:47:39 -03:00 committed by GitHub
commit 4f23572ab3

View file

@ -40,19 +40,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" ];
@ -73,6 +60,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)