Files
mtusi2026lab7/scripts/start.ps1
T

21 lines
1.2 KiB
PowerShell

$ErrorActionPreference = 'Stop'
Set-Location (Split-Path -Parent $PSScriptRoot)
function Invoke-Checked([string]$Program, [string[]]$Parameters) {
& $Program @Parameters
if ($LASTEXITCODE -ne 0) { throw "$Program failed with exit $LASTEXITCODE" }
}
& "$PSScriptRoot/init-env.ps1"
$compose = @('compose', '--project-name', 'mtusi-lab7-grade3')
Invoke-Checked docker ($compose + @('config', '--quiet'))
Invoke-Checked docker ($compose + @('build', 'migrate', 'tools', 's3-bootstrap'))
Invoke-Checked docker ($compose + @('up', '-d', 'openbao', 'postgres', 's3', 'broker',
'otel-collector', 'collector-local', 'prometheus', 'prometheus-local', 'loki', 'loki-local',
'tempo', 'tempo-local', 'grafana', 'lb'))
# This is the explicit local operator step. No OpenBao container reads the recovery file.
Invoke-Checked py @('-3', 'scripts/bao_operator.py', 'bootstrap')
Invoke-Checked docker ($compose + @('run', '--rm', '-T', 's3-bootstrap'))
Invoke-Checked docker ($compose + @('up', '-d', '--no-build', 'api1', 'api2', 'worker'))
Invoke-Checked py @('-3', '-c', "import sys; sys.path.insert(0, 'scripts'); from test_resilience import ready; ready(); print('PASS: HTTPS readiness')")