Релизованный минимум на 3, подготовка к написанию REPORT.md
This commit is contained in:
+3
-13
@@ -1,15 +1,5 @@
|
||||
@echo off
|
||||
cd /d %~dp0\..
|
||||
docker compose restart api postgres
|
||||
|
||||
set /a count=0
|
||||
:check_loop
|
||||
timeout /t 2 /nobreak >nul
|
||||
curl -s -f http://localhost:8080/health/ready >nul 2>&1
|
||||
if %errorlevel% equ 0 exit /b 0
|
||||
|
||||
set /a count+=1
|
||||
if %count% lss 15 goto check_loop
|
||||
|
||||
echo API failed to become ready
|
||||
exit /b 1
|
||||
echo Restarting API and Database...
|
||||
docker compose restart api-1 api-2 postgres
|
||||
exit /b 0
|
||||
@@ -0,0 +1,13 @@
|
||||
@echo off
|
||||
setlocal
|
||||
cd /d %~dp0\..
|
||||
if "%TARGET_INSTANCE_ID%"=="" (
|
||||
echo TARGET_INSTANCE_ID is not set 1>&2
|
||||
exit /b 2
|
||||
)
|
||||
if "%TARGET_INSTANCE_ID%"=="api-1" (set svc=api-1) else if "%TARGET_INSTANCE_ID%"=="api-2" (set svc=api-2) else (
|
||||
echo unknown TARGET_INSTANCE_ID: %TARGET_INSTANCE_ID% 1>&2
|
||||
exit /b 2
|
||||
)
|
||||
docker compose stop %svc%
|
||||
exit /b %errorlevel%
|
||||
Reference in New Issue
Block a user