fix(deploy): preserve rollback diagnostics
CI / Rust Checks (push) Successful in 12m38s
CI / UI Checks (push) Successful in 6s
CI / Community Image Smoke (push) Successful in 1m12s
CI / Frontend E2E (push) Successful in 4m55s
CI / Deploy (push) Failing after 31s

This commit is contained in:
2026-09-01 00:13:27 +03:00
parent 5818255cf5
commit dd5dbba1f6
2 changed files with 16 additions and 14 deletions
+11 -10
View File
@@ -26,11 +26,6 @@ compose_profiles=""
if [ "$cache_backend" = "valkey" ] || [ "$cache_backend" = "redis" ]; then if [ "$cache_backend" = "valkey" ] || [ "$cache_backend" = "redis" ]; then
compose_profiles="--profile cache" compose_profiles="--profile cache"
fi fi
postgres_scale=""
if [ "$(env_value POSTGRES_HOST postgres)" != "postgres" ]; then
postgres_scale="--scale postgres=0"
fi
compose() { compose() {
# Intentional word splitting: compose_profiles is either empty or two arguments. # Intentional word splitting: compose_profiles is either empty or two arguments.
# shellcheck disable=SC2086 # shellcheck disable=SC2086
@@ -38,11 +33,21 @@ compose() {
} }
compose_up() { compose_up() {
postgres_scale=""
if [ "$(env_value POSTGRES_HOST postgres)" != "postgres" ] \
&& compose config --services | grep -Fxq postgres; then
postgres_scale="--scale postgres=0"
fi
# Intentional word splitting: postgres_scale is either empty or two arguments. # Intentional word splitting: postgres_scale is either empty or two arguments.
# shellcheck disable=SC2086 # shellcheck disable=SC2086
compose up -d --remove-orphans $postgres_scale compose up -d --remove-orphans $postgres_scale
} }
show_failure_diagnostics() {
compose ps >&2 || true
compose logs --no-color migrate >&2 || true
}
wait_for_stack() { wait_for_stack() {
readiness_path="$1" readiness_path="$1"
attempt=1 attempt=1
@@ -129,10 +134,6 @@ rollback() {
if [ "$cache_backend" = "valkey" ] || [ "$cache_backend" = "redis" ]; then if [ "$cache_backend" = "valkey" ] || [ "$cache_backend" = "redis" ]; then
compose_profiles="--profile cache" compose_profiles="--profile cache"
fi fi
postgres_scale=""
if [ "$(env_value POSTGRES_HOST postgres)" != "postgres" ]; then
postgres_scale="--scale postgres=0"
fi
compose_up compose_up
wait_for_stack health wait_for_stack health
} }
@@ -142,7 +143,7 @@ create_backup
compose pull compose pull
if ! compose_up || ! wait_for_stack ready; then if ! compose_up || ! wait_for_stack ready; then
compose ps >&2 || true show_failure_diagnostics
rollback rollback
exit 1 exit 1
fi fi
+5 -4
View File
@@ -28,15 +28,16 @@ compose_profiles=""
if [ "$cache_backend" = "valkey" ] || [ "$cache_backend" = "redis" ]; then if [ "$cache_backend" = "valkey" ] || [ "$cache_backend" = "redis" ]; then
compose_profiles="--profile cache" compose_profiles="--profile cache"
fi fi
postgres_scale=""
if [ "$(env_value POSTGRES_HOST postgres)" != "postgres" ]; then
postgres_scale="--scale postgres=0"
fi
compose() { compose() {
# shellcheck disable=SC2086 # shellcheck disable=SC2086
docker compose $compose_profiles "$@" docker compose $compose_profiles "$@"
} }
compose_up() { compose_up() {
postgres_scale=""
if [ "$(env_value POSTGRES_HOST postgres)" != "postgres" ] \
&& compose config --services | grep -Fxq postgres; then
postgres_scale="--scale postgres=0"
fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
compose up -d --remove-orphans $postgres_scale compose up -d --remove-orphans $postgres_scale
} }