From a91afa60d3e4de963eb214ca0ddb7bff9fb109ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Mon, 2 Feb 2026 17:56:57 +0100 Subject: [PATCH] [IMP] fix undefined variable DB_CONTAINER_NAME Replace $DB_CONTAINER_NAME with $POSTGRES_SERVICE_NAME which is the correct variable exported from the parent script (upgrade.sh). DB_CONTAINER_NAME was never defined, causing the script to fail immediately with 'set -u' enabled (unbound variable error). The intended variable is POSTGRES_SERVICE_NAME which contains the name of the PostgreSQL container detected at runtime. --- prepare_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prepare_db.sh b/prepare_db.sh index 7aea271..cc0aad2 100755 --- a/prepare_db.sh +++ b/prepare_db.sh @@ -10,8 +10,8 @@ DB_FINALE_SERVICE="$4" echo "Start database preparation" # Check POSTGRES container is running -if ! docker ps | grep -q "$DB_CONTAINER_NAME"; then - printf "Docker container %s is not running.\n" "$DB_CONTAINER_NAME" >&2 +if ! docker ps | grep -q "$POSTGRES_SERVICE_NAME"; then + printf "Docker container %s is not running.\n" "$POSTGRES_SERVICE_NAME" >&2 exit 1 fi