[+] add project
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
cd "$ROOT"
|
||||
|
||||
docker compose restart postgres redis s3 >/dev/null
|
||||
deadline=$(( $(date +%s) + 60 ))
|
||||
for service in postgres redis; do
|
||||
container=$(docker compose ps -q "$service")
|
||||
while :; do
|
||||
status=$(docker inspect --format '{{if .State.Health}}{{.State.Health.Status}}{{else}}none{{end}}' "$container")
|
||||
if [ "$status" = healthy ]; then
|
||||
break
|
||||
fi
|
||||
if [ "$status" = unhealthy ] || [ "$(date +%s)" -ge "$deadline" ]; then
|
||||
printf '%s\n' "$service did not become healthy after restart" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
done
|
||||
|
||||
docker compose run --rm --no-deps s3-bootstrap >/dev/null
|
||||
"$ROOT/scripts/rolling-restart.sh"
|
||||
Reference in New Issue
Block a user