7 — Т2302 — ебедев — на 5
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# Start stopped workers and wait until healthy.
|
||||
$ErrorActionPreference = 'Continue'
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
Set-Location $root
|
||||
$envFile = if ($env:ENV_FILE) { $env:ENV_FILE } else { '.env' }
|
||||
function Wait-Healthy([string]$svc) {
|
||||
foreach ($cid in (& docker compose --env-file $envFile ps -q $svc)) {
|
||||
for ($i = 0; $i -lt 120; $i++) {
|
||||
if ((& docker inspect -f '{{.State.Health.Status}}' $cid) -eq 'healthy') { break }
|
||||
Start-Sleep -Milliseconds 500
|
||||
}
|
||||
}
|
||||
}
|
||||
& docker compose --env-file $envFile start worker 2>$null | Out-Null
|
||||
Wait-Healthy 'worker'
|
||||
& docker compose --env-file $envFile ps -a worker --format '{{.Name}} {{.State}} {{.Health}}'
|
||||
Reference in New Issue
Block a user