Restore scratch setup bootstrap and live frontdoor sweep

This commit is contained in:
master
2026-03-09 01:42:24 +02:00
parent abda749ffd
commit c9686edf07
13 changed files with 766 additions and 63 deletions

View File

@@ -273,6 +273,57 @@ function Initialize-EnvFile {
}
}
function Get-ComposeEnvValue([string]$key) {
$envFile = Join-Path $ComposeDir '.env'
if (-not (Test-Path $envFile)) {
return $null
}
foreach ($line in Get-Content $envFile) {
if ($line -match "^\s*$key=(.+)$") {
return $matches[1].Trim()
}
}
return $null
}
function Get-FrontdoorNetworkName {
if (-not [string]::IsNullOrWhiteSpace($env:FRONTDOOR_NETWORK)) {
return $env:FRONTDOOR_NETWORK.Trim()
}
$configured = Get-ComposeEnvValue 'FRONTDOOR_NETWORK'
if (-not [string]::IsNullOrWhiteSpace($configured)) {
return $configured
}
return 'stellaops_frontdoor'
}
function Ensure-FrontdoorNetwork {
$networkName = Get-FrontdoorNetworkName
if ([string]::IsNullOrWhiteSpace($networkName)) {
Write-Fail 'Unable to resolve the frontdoor Docker network name.'
exit 1
}
$existingNetworks = @(docker network ls --format '{{.Name}}' 2>$null)
if ($existingNetworks -contains $networkName) {
Write-Ok "Frontdoor network available ($networkName)"
return
}
Write-Warn "Frontdoor network missing ($networkName); creating it now."
docker network create $networkName | Out-Null
if ($LASTEXITCODE -ne 0) {
Write-Fail "Failed to create frontdoor network ($networkName)."
exit 1
}
Write-Ok "Created frontdoor network ($networkName)"
}
# ─── 4. Start infrastructure ───────────────────────────────────────────────
function Start-Infrastructure {
@@ -368,6 +419,7 @@ function Build-Images {
function Start-Platform {
Write-Step 'Starting full Stella Ops platform'
Ensure-FrontdoorNetwork
Push-Location $ComposeDir
try {
docker compose -f docker-compose.stella-ops.yml up -d