1
0
Files
pdf-umbenenner/run-m6.ps1
2026-04-07 13:36:35 +02:00

79 lines
2.9 KiB
PowerShell

# run-m6.ps1
# Fuehrt alle M6-Arbeitspakete sequenziell aus.
# Nach jedem AP wird der Build geprueft. Bei Fehler wird abgebrochen.
# Ausfuehren im Projektroot: .\run-m6.ps1
param(
[int]$StartAp = 1,
[int]$EndAp = 8,
[string]$Model = "claude-sonnet-4-6",
[string]$Workpackage = "M6"
)
$ErrorActionPreference = "Stop"
$BuildCmd = ".\mvnw.cmd clean verify -pl pdf-umbenenner-domain,pdf-umbenenner-application,pdf-umbenenner-adapter-out,pdf-umbenenner-adapter-in-cli,pdf-umbenenner-bootstrap --also-make"
function Get-Prompt {
param([int]$Ap)
$baseline = ""
if ($Ap -gt 1) {
$prev = $Ap - 1
$baseline = "AP-001 bis AP-00$prev sind bereits abgeschlossen und bilden die Baseline. "
}
$apFormatted = $Ap.ToString("D3")
return "Lies CLAUDE.md und 'docs/workpackages/$Workpackage - Arbeitspakete.md' vollständig. ${baseline}Implementiere ausschließlich AP-$apFormatted gemäß WORKFLOW.md."
}
Write-Host ""
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " $Workpackage Automatisierung" -ForegroundColor Cyan
Write-Host " Modell : $Model" -ForegroundColor Cyan
Write-Host " APs : $StartAp bis $EndAp" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
for ($ap = $StartAp; $ap -le $EndAp; $ap++) {
$apFormatted = $ap.ToString("D3")
Write-Host "----------------------------------------" -ForegroundColor Yellow
Write-Host " Starte AP-$apFormatted" -ForegroundColor Yellow
Write-Host "----------------------------------------" -ForegroundColor Yellow
$prompt = Get-Prompt -Ap $ap
# Claude Code ausfuehren
$claudeArgs = @("--model", $Model, "--dangerously-skip-permissions", "--print", $prompt)
& claude @claudeArgs
if ($LASTEXITCODE -ne 0) {
Write-Host ""
Write-Host "[FEHLER] Claude Code ist bei AP-$apFormatted fehlgeschlagen (Exit $LASTEXITCODE)." -ForegroundColor Red
Write-Host "Bitte AP-$apFormatted manuell pruefen und das Skript mit -StartAp $ap neu starten." -ForegroundColor Red
exit 1
}
# Build pruefen
Write-Host ""
Write-Host "[BUILD] Pruefe Build nach AP-$apFormatted ..." -ForegroundColor Cyan
Invoke-Expression $BuildCmd
if ($LASTEXITCODE -ne 0) {
Write-Host ""
Write-Host "[FEHLER] Build nach AP-$apFormatted fehlgeschlagen." -ForegroundColor Red
Write-Host "Bitte den Stand pruefen und das Skript mit -StartAp $ap neu starten." -ForegroundColor Red
exit 1
}
Write-Host ""
Write-Host "[OK] AP-$apFormatted abgeschlossen und Build gruen." -ForegroundColor Green
Write-Host ""
}
Write-Host "========================================" -ForegroundColor Green
Write-Host " $Workpackage vollstaendig abgeschlossen!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Green