forked from mtusi2026/mtusi2026lab2
22 lines
537 B
Bash
Executable File
22 lines
537 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
echo "[restart.sh] docker compose down (volumes preserved)"
|
|
docker compose --env-file .env down
|
|
|
|
echo "[restart.sh] docker compose up -d --build"
|
|
docker compose --env-file .env up -d --build
|
|
|
|
echo "[restart.sh] waiting for /health/ready"
|
|
for i in $(seq 1 90); do
|
|
if curl -fsS http://localhost:8080/health/ready >/dev/null 2>&1; then
|
|
echo "[restart.sh] api is ready"
|
|
exit 0
|
|
fi
|
|
sleep 1
|
|
done
|
|
|
|
echo "[restart.sh] api did not become ready in 90 seconds" >&2
|
|
exit 1 |