Files
mtusi2026lab2/scripts/restart.sh
T
2026-10-30 19:37:21 +03:00

18 lines
667 B
Bash

#!/bin/sh
# Restart hook for `make test-persistence ACTION_SCRIPT=scripts/restart.sh`.
# Recreates the API and BOTH state stores from the same images, keeping the
# named volumes (pgdata, valkeydata): no `down -v`, no seed, no data reset.
set -eu
cd "$(dirname "$0")/.."
ENV_FILE="${COMPOSE_ENV_FILE:-.env}"
printf '%s\n' "restart: stopping api, postgres and valkey (volumes preserved)"
docker compose --env-file "$ENV_FILE" down --timeout 15
printf '%s\n' "restart: starting api, postgres and valkey"
docker compose --env-file "$ENV_FILE" up -d --wait --wait-timeout 120
docker compose --env-file "$ENV_FILE" ps
printf '%s\n' "stack_restarted volumes_preserved"