Files
mtusi2026lab4/scripts/restart-stack.bat
T
2026-10-26 16:10:22 +03:00

29 lines
543 B
Batchfile

@echo off
setlocal EnableDelayedExpansion
cd /d "%~dp0.."
set TMP=%TEMP%\lab4-restart
if not exist "%TMP%" mkdir "%TMP%"
echo Restarting stack without removing volumes...
docker compose --compatibility restart
set COUNT=0
:wait
set /a COUNT+=1
if %COUNT% GTR 90 (
echo FAIL: stack did not become ready in time
exit /b 1
)
curl.exe -s -o nul -w "%%{http_code}" http://localhost:8080/health/ready > "%TMP%\code.txt"
set /p C=<"%TMP%\code.txt"
if "%C%"=="200" (
echo Stack is ready.
exit /b 0
)
timeout /t 1 /nobreak >nul
goto wait