Files
mtusi2026lab7/scripts/restart.sh
T

16 lines
982 B
Bash
Executable File

#!/usr/bin/env bash
# Restart hook for `make test-persistence ACTION_SCRIPT=scripts/restart.sh`.
# Restarts all application, stateful data, and telemetry containers with volumes
# preserved. OpenBao remains unsealed across ordinary stand restarts (per
# contracts/trust-matrix.md); OpenBao restart + manual operator unseal is tested
# explicitly in scripts/lab7/openbao_lifecycle.py.
set -euo pipefail
compose=(docker compose --env-file "${COMPOSE_ENV_FILE:-.env}")
# Stop otel-collector before restarting otel-gateway (shared netns owner) so
# otel-collector cleanly re-attaches to the fresh otel-gateway network namespace.
"${compose[@]}" stop otel-collector
"${compose[@]}" restart postgres redis s3 broker api worker haproxy otel-gateway prometheus loki tempo grafana
"${compose[@]}" up -d --no-build --no-recreate --no-deps --wait postgres redis s3 broker api worker haproxy otel-gateway prometheus loki tempo grafana
"${compose[@]}" up -d --no-build --no-deps otel-collector