forked from mtusi2026/mtusi2026lab3
ЛР 3 — БПИ2302 — Щербацевич — на 5
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
@echo off
|
||||
setlocal
|
||||
cd /d "%~dp0.."
|
||||
if "%TARGET_INSTANCE_ID%"=="" (
|
||||
echo TARGET_INSTANCE_ID is required 1>&2
|
||||
exit /b 2
|
||||
)
|
||||
for /f "delims=" %%I in ('docker compose ps -aq -- api') do (
|
||||
for /f "delims=" %%H in ('docker inspect -f "{{.Config.Hostname}}" %%I') do (
|
||||
if /I "%%H"=="%TARGET_INSTANCE_ID%" (
|
||||
docker stop -t 5 %%I >nul
|
||||
exit /b 0
|
||||
)
|
||||
)
|
||||
)
|
||||
echo no API replica matches TARGET_INSTANCE_ID 1>&2
|
||||
exit /b 1
|
||||
Reference in New Issue
Block a user