forked from mtusi2026/mtusi2026lab4
29 lines
543 B
Batchfile
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 |