86 lines
2.6 KiB
PowerShell
86 lines
2.6 KiB
PowerShell
$projectRoot = "C:\Users\surov\Documents\AZA\backup 24.2.26"
|
|
$buildScript = Join-Path $projectRoot "build_exe.ps1"
|
|
$smokeScript = Join-Path $projectRoot "run_desktop_smoke_test.ps1"
|
|
$manifestScript = Join-Path $projectRoot "build_release_manifest.ps1"
|
|
|
|
function Stop-AzaProcessesForCleanSmokeTest {
|
|
Write-Host "Bereinige alte lokale AZA-/Backend-Prozesse vor dem Smoke Test..."
|
|
|
|
try {
|
|
$connections = Get-NetTCPConnection -LocalPort 8000 -State Listen -ErrorAction SilentlyContinue
|
|
if ($connections) {
|
|
$pids = $connections | Select-Object -ExpandProperty OwningProcess -Unique
|
|
foreach ($pid in $pids) {
|
|
try {
|
|
$proc = Get-Process -Id $pid -ErrorAction SilentlyContinue
|
|
if ($proc) {
|
|
Write-Host ("Stoppe Prozess auf Port 8000: " + $proc.ProcessName + " (PID " + $pid + ")")
|
|
Stop-Process -Id $pid -Force -ErrorAction SilentlyContinue
|
|
}
|
|
}
|
|
catch {
|
|
}
|
|
}
|
|
Start-Sleep -Seconds 2
|
|
}
|
|
}
|
|
catch {
|
|
}
|
|
|
|
foreach ($name in @("aza_desktop")) {
|
|
try {
|
|
$procs = Get-Process -Name $name -ErrorAction SilentlyContinue
|
|
if ($procs) {
|
|
foreach ($proc in $procs) {
|
|
Write-Host ("Stoppe haengende Test-EXE: " + $proc.ProcessName + " (PID " + $proc.Id + ")")
|
|
Stop-Process -Id $proc.Id -Force -ErrorAction SilentlyContinue
|
|
}
|
|
}
|
|
}
|
|
catch {
|
|
}
|
|
}
|
|
}
|
|
|
|
if (-not (Test-Path $buildScript)) {
|
|
Write-Error "Build-Script nicht gefunden: $buildScript"
|
|
exit 1
|
|
}
|
|
|
|
if (-not (Test-Path $smokeScript)) {
|
|
Write-Error "Smoke-Test-Script nicht gefunden: $smokeScript"
|
|
exit 1
|
|
}
|
|
|
|
if (-not (Test-Path $manifestScript)) {
|
|
Write-Error "Manifest-Script nicht gefunden: $manifestScript"
|
|
exit 1
|
|
}
|
|
|
|
Write-Host "=== AZA Desktop: Build ==="
|
|
powershell -ExecutionPolicy Bypass -File $buildScript
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Error "Build fehlgeschlagen."
|
|
exit 1
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "=== AZA Desktop: Release Manifest ==="
|
|
powershell -ExecutionPolicy Bypass -File $manifestScript
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Error "Release Manifest fehlgeschlagen."
|
|
exit 1
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "=== AZA Desktop: Smoke Test ==="
|
|
Stop-AzaProcessesForCleanSmokeTest
|
|
powershell -ExecutionPolicy Bypass -File $smokeScript
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Error "Smoke Test fehlgeschlagen."
|
|
exit 1
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "AZA Desktop Build + Smoke Test erfolgreich."
|