Реализовать лабораторную 4 на оценку 5
Добавить приватное S3-хранилище, вложения, presigned upload, reconciler и доказательства.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
Set-Location $root
|
||||
|
||||
$target = $env:TARGET_INSTANCE_ID
|
||||
if ([string]::IsNullOrWhiteSpace($target)) { exit 2 }
|
||||
|
||||
$ids = @(docker compose --env-file .env ps -q api)
|
||||
foreach ($id in $ids) {
|
||||
if ([string]::IsNullOrWhiteSpace($id)) { continue }
|
||||
$hostName = (docker inspect --format '{{.Config.Hostname}}' $id).Trim()
|
||||
$containerName = (docker inspect --format '{{.Name}}' $id).Trim().TrimStart('/')
|
||||
if ($hostName -eq $target -or $hostName.StartsWith($target) -or
|
||||
$target.StartsWith($hostName) -or $containerName -eq $target) {
|
||||
docker stop --time 5 $id | Out-Null
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
|
||||
Write-Error 'stop-one: no API replica matches TARGET_INSTANCE_ID'
|
||||
exit 3
|
||||
Reference in New Issue
Block a user