forked from mtusi2026/mtusi2026lab7
23 lines
1012 B
PowerShell
23 lines
1012 B
PowerShell
$ErrorActionPreference = 'Stop'
|
|
Set-Location (Split-Path $PSScriptRoot -Parent)
|
|
$Python = Join-Path (Get-Location) '.venv\Scripts\python.exe'
|
|
|
|
function Invoke-Step {
|
|
param([string]$Program, [string[]]$Arguments)
|
|
& $Program @Arguments
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw "Step failed: $Program $($Arguments[0])"
|
|
}
|
|
}
|
|
|
|
Invoke-Step $Python @('scripts/bootstrap.py')
|
|
Invoke-Step $Python @('scripts/provision.py', 'prepare')
|
|
Invoke-Step 'docker' @('compose', 'build')
|
|
Invoke-Step 'docker' @('compose', 'run', '--rm', '--no-deps', '-T', 'bao-permissions')
|
|
Invoke-Step 'docker' @('compose', 'run', '--rm', '--no-deps', '-T', 's3-permissions')
|
|
Invoke-Step 'docker' @('compose', 'up', '-d', '--wait', '--wait-timeout', '120', 'gateway', 'db', 'minio', 'openbao')
|
|
Invoke-Step $Python @('scripts/provision.py', 'bao')
|
|
Invoke-Step $Python @('scripts/provision.py', 'db')
|
|
Invoke-Step $Python @('scripts/provision.py', 's3')
|
|
Invoke-Step 'docker' @('compose', 'up', '-d', '--wait', '--wait-timeout', '180')
|