Перенос из 3 лабы

This commit is contained in:
Dmitry
2026-11-09 21:34:03 +03:00
parent ec540a1a72
commit 034d5537cf
77 changed files with 3253 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/bin/sh
set -eu
# scripts/ -> корень репо -> Lido
ROOT="$(CDPATH= cd -- "$(dirname "$0")/../Lido" && pwd)"
cd "$ROOT"
if [ ! -f docker-compose.yml ] && [ ! -f compose.yaml ] && [ ! -f compose.yml ]; then
echo "compose file not found in $ROOT" >&2
exit 1
fi
CID="$(docker compose ps -q api | head -n 1)"
if [ -z "$CID" ]; then
echo "no api replica found" >&2
exit 1
fi
docker stop "$CID"
exit 0
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
set -eu
ROOT="$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)"
cd "$ROOT/Lido"
docker compose -f docker-compose.yml restart db api redis
BASE_URL="${BASE_URL:-http://127.0.0.1:8080}"
i=0
while [ "$i" -lt 60 ]; do
if curl -sf "$BASE_URL/health/live" >/dev/null 2>&1 \
|| curl -sf "$BASE_URL/actuator/health" >/dev/null 2>&1; then
exit 0
fi
i=$((i + 1))
sleep 1
done
echo "API not ready" >&2
exit 1