forked from mtusi2026/mtusi2026lab6
Реализована лабораторная 6 на оценку 4
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
wait_healthy() {
|
||||
service=$1
|
||||
container_id=$(docker compose --env-file .env ps -q "$service")
|
||||
attempts=0
|
||||
until [ "$(docker inspect --format '{{.State.Health.Status}}' "$container_id" 2>/dev/null || true)" = healthy ]; do
|
||||
attempts=$((attempts + 1))
|
||||
if [ "$attempts" -ge 60 ]; then
|
||||
printf '%s\n' "$service did not become healthy" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
docker compose --env-file .env restart postgres redis s3 broker >/dev/null
|
||||
wait_healthy postgres
|
||||
wait_healthy redis
|
||||
wait_healthy s3
|
||||
wait_healthy broker
|
||||
docker compose --env-file .env restart api1 api2 cleanup dispatcher worker >/dev/null
|
||||
wait_healthy api1
|
||||
wait_healthy api2
|
||||
docker compose --env-file .env restart nginx otel-collector prometheus loki tempo grafana >/dev/null
|
||||
wait_healthy nginx
|
||||
Reference in New Issue
Block a user