Files
mtusi2026lab7/scripts/restart.sh
T
dykhanovaa 4b21efc2cc
Skeleton contracts / contracts (pull_request) Canceled after 0s
lab7 completed
2026-11-20 20:37:41 +03:00

19 lines
754 B
Bash
Executable File

#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
docker compose stop -t 2 api1 api2 worker
docker compose restart -t 5 postgres seaweed rabbitmq prometheus-db loki-db tempo-db grafana
# Unless the operator explicitly requests a seal/unseal exercise, OpenBao stays
# available for services to authenticate again during this business-data test.
if [ "${RESTART_OPENBAO:-0}" = 1 ]; then
docker compose restart -t 5 openbao
attempts=0
until curl --silent --cacert secrets/ca/ca.crt https://localhost:8200/v1/sys/seal-status >/dev/null; do
attempts=$((attempts+1))
[ "$attempts" -lt 15 ] || exit 1
sleep 1
done
python3 scripts/bao-operator.py unseal </dev/tty >/dev/tty 2>/dev/tty
fi
docker compose start api1 api2 worker