init
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions
|
||||
cd /d "%~dp0\.."
|
||||
|
||||
set /a REPLICA_COUNT=0
|
||||
for /f "usebackq delims=" %%C in (`docker compose --env-file .env ps -q api`) do set /a REPLICA_COUNT+=1
|
||||
if %REPLICA_COUNT% LSS 2 exit /b 2
|
||||
|
||||
for /f "usebackq delims=" %%C in (`docker compose --env-file .env ps -q api`) do call :replace_one %%C
|
||||
exit /b 0
|
||||
|
||||
:replace_one
|
||||
docker stop --time 10 %1 >nul || exit /b 1
|
||||
docker rm %1 >nul || exit /b 1
|
||||
docker compose --env-file .env up -d --wait --wait-timeout 90 --no-deps --scale api=2 api >nul || exit /b 1
|
||||
exit /b 0
|
||||
Reference in New Issue
Block a user