ЛР 2 — БПИ2304 — Кирюпина — на 3
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
SashaKirupina
2026-11-05 13:46:46 +03:00
parent 65003b6119
commit 0c179a44a3
28 changed files with 984 additions and 20 deletions
+20
View File
@@ -0,0 +1,20 @@
$ErrorActionPreference = 'Stop'
Push-Location (Split-Path $PSScriptRoot -Parent)
try {
function Snapshot {
foreach ($service in @('api', 'db')) {
$containerId = docker compose ps -q $service
if ($LASTEXITCODE -ne 0 -or -not $containerId) { throw 'Container not found' }
docker inspect --format '{{.Name}} started={{.State.StartedAt}} status={{.State.Status}} volumes={{range .Mounts}}{{.Name}} {{end}}' $containerId
if ($LASTEXITCODE -ne 0) { throw 'Inspect failed' }
}
}
Snapshot | Set-Content evidence/restart-scope.txt
docker compose stop api db
if ($LASTEXITCODE -ne 0) { throw 'Stop failed' }
docker compose up -d --wait --wait-timeout 30 db
if ($LASTEXITCODE -ne 0) { throw 'Database start failed' }
docker compose up -d --wait --wait-timeout 30 api
if ($LASTEXITCODE -ne 0) { throw 'API start failed' }
Snapshot | Add-Content evidence/restart-scope.txt
} finally { Pop-Location }