From 4d16297418a2b34556a81628d089ef4f8dd1174b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ma=CC=88der?= Date: Mon, 5 Mar 2018 15:15:27 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20Check=20variant=20when=20c?= =?UTF-8?q?hecking=20latest=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-latest.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build-latest.sh b/build-latest.sh index d5728b6..f8b2f24 100755 --- a/build-latest.sh +++ b/build-latest.sh @@ -44,11 +44,18 @@ BEARER_TOKEN="$($CURL "${URL_DOCKERHUB_TOKEN}" | jq -r .token)" URL_DOCKERHUB_TAG="https://registry.hub.docker.com/v2/${DOCKERHUB_REPO}/tags/list" AUTHORIZATION_HEADER="Authorization: Bearer ${BEARER_TOKEN}" -ALREADY_BUILT="$($CURL -H "${AUTHORIZATION_HEADER}" "${URL_DOCKERHUB_TAG}" | jq -e ".tags | any(.==\"${VERSION}\")")" + +if [ -z "$VARIANT" ]; then + DOCKER_TAG="${VERSION}" +else + DOCKER_TAG="${VERSION}-${VARIANT}" +fi + +ALREADY_BUILT="$($CURL -H "${AUTHORIZATION_HEADER}" "${URL_DOCKERHUB_TAG}" | jq -e ".tags | any(.==\"${DOCKER_TAG}\")")" if [ "$ALREADY_BUILT" == "false" ]; then # shellcheck disable=SC2068 ./build.sh "${VERSION}" $@ else - echo "✅ ${VERSION} already exists on https://hub.docker.com/r/${DOCKERHUB_REPO}" + echo "✅ ${DOCKER_TAG} already exists on https://hub.docker.com/r/${DOCKERHUB_REPO}" fi