❇️ Adds DEBUG option

This commit is contained in:
Christian Mäder 2018-03-05 14:30:30 +01:00
parent 8f001adef4
commit 30a37511e2
No known key found for this signature in database
GPG Key ID: 92FFD0A711F196BB
2 changed files with 17 additions and 4 deletions

View File

@ -27,8 +27,12 @@ if [ "${PRERELEASE}" == "true" ]; then
if ( [ "$MAJOR_STABLE" -eq "$MAJOR_UNSTABLE" ] && [ "$MINOR_STABLE" -ge "$MINOR_UNSTABLE" ] ) \ if ( [ "$MAJOR_STABLE" -eq "$MAJOR_UNSTABLE" ] && [ "$MINOR_STABLE" -ge "$MINOR_UNSTABLE" ] ) \
|| [ "$MAJOR_STABLE" -gt "$MAJOR_UNSTABLE" ]; then || [ "$MAJOR_STABLE" -gt "$MAJOR_UNSTABLE" ]; then
exit 0
echo "❎ Latest unstable version ('$VERSION') is not higher than the latest stable version ('$STABLE_VERSION')." echo "❎ Latest unstable version ('$VERSION') is not higher than the latest stable version ('$STABLE_VERSION')."
if [ -z "$DEBUG" ]; then
exit 0
else
echo "⚠️ Would exit here with code '0', but DEBUG is enabled."
fi
fi fi
fi fi

View File

@ -9,6 +9,8 @@ if [ "${1}x" == "x" ] || [ "${1}" == "--help" ] || [ "${1}" == "-h" ]; then
echo " --push Pushes built Docker image to docker hub." echo " --push Pushes built Docker image to docker hub."
echo "" echo ""
echo "You can use the following ENV variables to customize the build:" echo "You can use the following ENV variables to customize the build:"
echo " DEBUG If defined, the script does not stop when certain checks are unsatisfied."
echo " DRY_RUN Prints all build statements instead of running them."
echo " DOCKER_OPTS Add parameters to Docker." echo " DOCKER_OPTS Add parameters to Docker."
echo " Default:" echo " Default:"
echo " When <TAG> starts with 'v': \"\"" echo " When <TAG> starts with 'v': \"\""
@ -86,9 +88,16 @@ if [ -z "$VARIANT" ]; then
else else
DOCKERFILE="Dockerfile.${VARIANT}" DOCKERFILE="Dockerfile.${VARIANT}"
DOCKER_TAG="${DOCKER_TAG}-${VARIANT}" DOCKER_TAG="${DOCKER_TAG}-${VARIANT}"
if [ ! -f ${DOCKERFILE} ]; then
echo "The Dockerfile ${DOCKERFILE} for variant '${VARIANT}' doesn't exist. Exiting" # Fail fast
if [ ! -f "${DOCKERFILE}" ]; then
echo "🚨 The Dockerfile ${DOCKERFILE} for variant '${VARIANT}' doesn't exist."
if [ -z "$DEBUG" ]; then
exit 1 exit 1
else
echo "⚠️ Would exit here with code '1', but DEBUG is enabled."
fi
fi fi
fi fi