complete level 5 track 1
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0restart.ps1"
|
||||
exit /b %ERRORLEVEL%
|
||||
@@ -0,0 +1,3 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
docker compose --env-file .env restart db redis api lb
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# Restart API and state stores. Volumes are untouched -> data, sessions
|
||||
# and idempotency keys survive.
|
||||
# migrate is one-shot (exited 0) and is intentionally not restarted here.
|
||||
docker compose --env-file .env restart db redis api lb
|
||||
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0stop-one.ps1"
|
||||
exit /b %ERRORLEVEL%
|
||||
@@ -0,0 +1,14 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
if (-not $env:TARGET_INSTANCE_ID) {
|
||||
Write-Error "TARGET_INSTANCE_ID is not set"
|
||||
exit 2
|
||||
}
|
||||
|
||||
$id = $env:TARGET_INSTANCE_ID
|
||||
$logDir = "evidence\lab3"
|
||||
New-Item -ItemType Directory -Force -Path $logDir | Out-Null
|
||||
|
||||
docker stop $id | Out-Null
|
||||
docker logs $id 2>&1 | Out-File -Encoding utf8 "$logDir\api-$id.log"
|
||||
Write-Host "saved $logDir\api-$id.log"
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
|
||||
|
||||
# X-Instance-Id = short container ID (lab3 implementation detail).
|
||||
# docker stop resolves short IDs natively.
|
||||
docker stop "$TARGET_INSTANCE_ID"
|
||||
Reference in New Issue
Block a user