Skip to content

Commit

Permalink
fix DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
cimnine committed Feb 7, 2019
1 parent 740fa81 commit fda1c27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build-latest.sh
Expand Up @@ -55,15 +55,15 @@ 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}"

if [ -z "$VARIANT" ]; then
if [ -z "$VARIANT" ] || [ "$VARIANT" == "main" ]; 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 [ -n "$DEBUG" ] && [ "$ALREADY_BUILT" == "false" ]; then
if [ -n "$DEBUG" ] || [ "$ALREADY_BUILT" == "false" ]; then
if [ -n "$DEBUG" ]; then
echo "⚠️ Would not build, because ${DOCKER_TAG} already exists on https://hub.docker.com/r/${DOCKERHUB_REPO}, but DEBUG is enabled."
fi
Expand Down

0 comments on commit fda1c27

Please sign in to comment.