lab3 completed
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
docker compose restart
|
||||
:wait
|
||||
curl -fsS http://127.0.0.1:8080/health/ready | findstr /C:"\"status\":\"ok\"" >nul
|
||||
if errorlevel 1 (
|
||||
timeout /t 1 /nobreak >nul
|
||||
goto wait
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
# TODO: copy to stop-one.sh, map TARGET_INSTANCE_ID to ONE API container/task.
|
||||
# Stop that instance and leave it stopped; no stop of DB/LB/volumes.
|
||||
# Return quickly (within 10 s); the test sends requests during this script.
|
||||
# Restore the replica explicitly after the test. Never print credentials.
|
||||
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
|
||||
printf '%s
|
||||
' 'TODO: implement stop-one.sh for your infrastructure' >&2
|
||||
exit 2
|
||||
@@ -0,0 +1,14 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set "REPLICA=%~1"
|
||||
|
||||
if "%REPLICA%"=="" set "REPLICA=api1"
|
||||
|
||||
if not "%REPLICA%"=="api1" if not "%REPLICA%"=="api2" (
|
||||
echo Usage: stop-one.bat [api1^|api2]
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
docker compose stop %REPLICA%
|
||||
exit /b %ERRORLEVEL%
|
||||
Reference in New Issue
Block a user