#!/bin/sh # Restart hook for `make test-persistence ACTION_SCRIPT=scripts/restart.sh`. # Restarts every long-lived API and storage process while preserving volumes. set -eu cd "$(dirname "$0")/.." ENV_FILE="${COMPOSE_ENV_FILE:-.env}" printf '%s\n' "restart: restarting API, PostgreSQL, Valkey and S3 (volumes preserved)" # The resilience test owns readiness waiting. The persistent bucket was already # created by the idempotent one-shot s3-init bootstrap service. docker compose --env-file "$ENV_FILE" restart --timeout 15 postgres valkey s3 api-1 api-2 nginx docker compose --env-file "$ENV_FILE" ps printf '%s\n' "stack_restarted volumes_preserved"