[FIX] correct 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.
This commit is contained in:
@@ -10,8 +10,8 @@ DB_FINALE_SERVICE="$4"
|
|||||||
echo "Start database preparation"
|
echo "Start database preparation"
|
||||||
|
|
||||||
# Check POSTGRES container is running
|
# Check POSTGRES container is running
|
||||||
if ! docker ps | grep -q "$DB_CONTAINER_NAME"; then
|
if ! docker ps | grep -q "$POSTGRES_SERVICE_NAME"; then
|
||||||
printf "Docker container %s is not running.\n" "$DB_CONTAINER_NAME" >&2
|
printf "Docker container %s is not running.\n" "$POSTGRES_SERVICE_NAME" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user