This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
@echo off
|
||||
setlocal
|
||||
if not defined TARGET_INSTANCE_ID (
|
||||
echo TARGET_INSTANCE_ID is required 1>&2
|
||||
exit /b 2
|
||||
)
|
||||
cd /d "%~dp0.."
|
||||
for /f "delims=" %%I in ('docker compose ps -q api') do (
|
||||
for /f "delims=" %%H in ('docker inspect --format "{{.Config.Hostname}}" %%I') do (
|
||||
if "%%H"=="%TARGET_INSTANCE_ID%" (
|
||||
docker stop --time 2 %%I >NUL
|
||||
exit /b %errorlevel%
|
||||
)
|
||||
)
|
||||
)
|
||||
echo No running API replica matches TARGET_INSTANCE_ID 1>&2
|
||||
exit /b 1
|
||||
Reference in New Issue
Block a user