Consistent variable use in build scripts
This commit is contained in:
parent
1c42f14bf0
commit
c7ab15f914
3 changed files with 30 additions and 3 deletions
|
@ -47,7 +47,7 @@ if [ "${PRERELEASE}" == "true" ]; then
|
|||
fi
|
||||
|
||||
# Check if that version is not already available on docker hub:
|
||||
ORIGINAL_DOCKERHUB_REPO="netboxcommunity/netbox"
|
||||
ORIGINAL_DOCKERHUB_REPO="${DOCKER_ORG-netboxcommunity}/${DOCKER_REPO-netbox}"
|
||||
DOCKERHUB_REPO="${DOCKERHUB_REPO-$ORIGINAL_DOCKERHUB_REPO}"
|
||||
URL_DOCKERHUB_TOKEN="https://auth.docker.io/token?service=registry.docker.io&scope=repository:${DOCKERHUB_REPO}:pull"
|
||||
BEARER_TOKEN="$($CURL "${URL_DOCKERHUB_TOKEN}" | jq -r .token)"
|
||||
|
@ -63,7 +63,11 @@ fi
|
|||
|
||||
ALREADY_BUILT="$($CURL -H "${AUTHORIZATION_HEADER}" "${URL_DOCKERHUB_TAG}" | jq -e ".tags | any(.==\"${DOCKER_TAG}\")")"
|
||||
|
||||
if [ "$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
|
||||
|
||||
# shellcheck disable=SC2068
|
||||
./build.sh "${VERSION}" $@
|
||||
exit $?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue