ci(dbcleanup): Fix RUN cluster cleanup

This commit is contained in:
Thorsten Roßner
2025-07-20 19:22:52 +02:00
parent 50315d78ee
commit af94d28b6a

View File

@@ -83,11 +83,12 @@ variables:
FLUSH_EXTERNAL_SERVICES_TYPE: FLUSH_EXTERNAL_SERVICES_TYPE:
description: > description: >
Select the type of external services (e.g. "RUN", or "STACKIT"), as they require different Select the type of external services (e.g. "RUN", or "STACKIT"), as they require different
cleanup strategies. Requires `FLUSH_EXTERNAL_SERVICES_BEFORE=yes`. cleanup strategies. Requires `FLUSH_EXTERNAL_SERVICES_BEFORE=yes` and `ENV_STOP_BEFORE=yes`.
value: "STACKIT" value: "CHANGE ME"
options: options:
- "RUN" - "RUN"
- "STACKIT" - "STACKIT"
- "CHANGE ME"
DEBUG_ENABLED: DEBUG_ENABLED:
description: > description: >
Allows to set `debug.enabled` to true for a deployment, needs to be supported by stage specific Allows to set `debug.enabled` to true for a deployment, needs to be supported by stage specific
@@ -386,7 +387,7 @@ db-cleanup:
echo "[psql] [${ENV_DATABASE}] DROP OWNED BY ${PGUSER} in ${POSTGRES_DATABASE} on ${PGHOST}" echo "[psql] [${ENV_DATABASE}] DROP OWNED BY ${PGUSER} in ${POSTGRES_DATABASE} on ${PGHOST}"
psql -c "DROP OWNED BY ${PGUSER}" || true; psql -c "DROP OWNED BY ${PGUSER}" || true;
;; ;;
*) "RUN")
# Usually, e.g. in "RUN" cluster, databases can simply be dropped and recreated # Usually, e.g. in "RUN" cluster, databases can simply be dropped and recreated
echo "[psql] [${ENV_DATABASE}] DROP ${POSTGRES_DATABASE} on ${PGHOST}" echo "[psql] [${ENV_DATABASE}] DROP ${POSTGRES_DATABASE} on ${PGHOST}"
psql -c "DROP DATABASE ${POSTGRES_DATABASE}" || true; psql -c "DROP DATABASE ${POSTGRES_DATABASE}" || true;