change build.sh better comments

This commit is contained in:
2026-04-28 13:57:43 +02:00
parent 3047e89326
commit fa3dbe180a

View File

@@ -25,17 +25,17 @@
# -o pipefail: Make pipelines fail if any command in the pipe fails, not just the last one
set -euo pipefail
# --- services to build (subfolder name = image suffix) ---------------------
#SERVICES=(backend frontend)
#cd to script dir
pushd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null
SCRIPT_DIR="$(pwd)"
source "${SCRIPT_DIR}/.env"
# read from .env:
# REGISTRY, IMAGE_NAME, IMAGE_VERSION, SNAPSHOT_TAG
# SERVICES (subfolder name = image suffix)
popd > /dev/null
#default: snapshot
VERSION="${IMAGE_TAG}-${SNAPSHOT_TAG}"
#default: build snapshot
VERSION="${IMAGE_VERSION}-${SNAPSHOT_TAG}" # read from .env
PUSH=false
ONLY=()
@@ -64,7 +64,7 @@ if [[ ${#ONLY[@]} -gt 0 ]]; then
fi
echo "============================================"
echo " ${IMAGE_NAME} - Docker Build"
echo " Docker Build - ${IMAGE_NAME}"
echo ""
echo " Services : ${SERVICES[*]}"
echo " Version : ${VERSION}"
@@ -83,7 +83,7 @@ done
# --- push -------------------------------------------------------------------
if $PUSH; then
docker login "${REGISTRY}"
docker login "${REGISTRY}" # read from .env
for SERVICE in "${SERVICES[@]}"; do
IMAGE="${REGISTRY}/${IMAGE_NAME}-${SERVICE}:${VERSION}"
echo ""