fix: update image handling in build script to use AZURITE_IMAGE variable consistently
This commit is contained in:
14
build.sh
14
build.sh
@@ -4,6 +4,7 @@ ARCH=()
|
||||
VERSION_ARG=()
|
||||
VERSION=""
|
||||
REGISTRY=""
|
||||
AZURITE_IMAGE="${AZURITE_IMAGE:-azurite:latest}"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
@@ -33,18 +34,17 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -z "$REGISTRY" ]]; then
|
||||
IMAGE="azurite"
|
||||
else
|
||||
IMAGE="$REGISTRY/azurite"
|
||||
if [[ ! -z "$REGISTRY" ]]; then
|
||||
# Prepend the registry to the image name for tagging.
|
||||
AZURITE_IMAGE="$REGISTRY/${AZURITE_IMAGE#*/}"
|
||||
fi
|
||||
|
||||
if [[ -z "$VERSION" ]]; then
|
||||
TAG_ARGS=("--tag" "$IMAGE:latest")
|
||||
TAG_ARGS=("--tag" "${AZURITE_IMAGE%:*}:latest")
|
||||
elif [[ "$VERSION" == "latest" ]]; then
|
||||
TAG_ARGS=("--tag" "$IMAGE:${LATEST_TAG#v}" "--tag" "$IMAGE:latest")
|
||||
TAG_ARGS=("--tag" "${AZURITE_IMAGE%:*}:${LATEST_TAG#v}" "--tag" "${AZURITE_IMAGE%:*}:latest")
|
||||
else
|
||||
TAG_ARGS=("--tag" "$IMAGE:${VERSION#v}")
|
||||
TAG_ARGS=("--tag" "${AZURITE_IMAGE%:*}:${VERSION#v}")
|
||||
fi
|
||||
|
||||
echo "Effective command line arguments:" ${ARCH[@]} ${VERSION_ARG[@]} ${TAG_ARGS[@]}
|
||||
|
||||
Reference in New Issue
Block a user