refactor(burn-in): remove -SkipArtifact; build.ps1 always produces dist/
This commit is contained in:
@@ -126,12 +126,6 @@ param(
|
||||
# and VMware Tools HGFS driver present in the guest.
|
||||
[switch] $UseSharedCache,
|
||||
|
||||
# When set, skip artifact packaging and do NOT write artifacts.zip in the guest.
|
||||
# Use for burn-in / smoke builds that intentionally produce no output.
|
||||
# In production (default: absent) the build MUST produce GuestArtifactSource or the
|
||||
# job fails — a silently-empty build is treated as an error.
|
||||
[switch] $SkipArtifact,
|
||||
|
||||
# Guest OS type — Linux uses SSH instead of WinRM.
|
||||
[ValidateSet('Windows', 'Linux')]
|
||||
[string] $GuestOS = 'Windows',
|
||||
@@ -433,7 +427,7 @@ try {
|
||||
# ── Custom build command (e.g. python, msbuild, cmake…) ──────────
|
||||
Write-Host "[Invoke-RemoteBuild] Running build command: $BuildCommand"
|
||||
$buildExit = Invoke-Command -Session $session -ScriptBlock {
|
||||
param($workDir, $cmd, $artifactZip, $artifactSrc, $useCache, $extraEnv, $skipArt)
|
||||
param($workDir, $cmd, $artifactZip, $artifactSrc, $useCache, $extraEnv)
|
||||
# Unbuffered Python output — lines appear in real-time instead of being held in buffer
|
||||
$env:PYTHONUNBUFFERED = '1'
|
||||
if ($useCache) {
|
||||
@@ -448,14 +442,14 @@ try {
|
||||
& cmd /c "$cmd 2>&1" | ForEach-Object { Write-Host $_ }
|
||||
$exit = $LASTEXITCODE
|
||||
|
||||
if ($exit -eq 0 -and -not $skipArt) {
|
||||
if ($exit -eq 0) {
|
||||
$archiveDir = Split-Path $artifactZip -Parent
|
||||
if (-not (Test-Path $archiveDir)) {
|
||||
New-Item -ItemType Directory -Path $archiveDir -Force | Out-Null
|
||||
}
|
||||
$srcPath = Join-Path $workDir $artifactSrc
|
||||
if (-not (Test-Path $srcPath)) {
|
||||
throw "Artifact source directory not found: $srcPath. Build succeeded (exit 0) but produced no output. Check GuestArtifactSource or use -SkipArtifact for builds that intentionally produce no files."
|
||||
throw "Artifact source directory not found: $srcPath. Build succeeded (exit 0) but produced no output. Check GuestArtifactSource."
|
||||
}
|
||||
else {
|
||||
$7zip = 'C:\Program Files\7-Zip\7z.exe'
|
||||
@@ -471,7 +465,7 @@ try {
|
||||
}
|
||||
|
||||
return $exit
|
||||
} -ArgumentList $GuestWorkDir, $BuildCommand, $GuestArtifactZip, $GuestArtifactSource, $UseSharedCache.IsPresent, $ExtraGuestEnv, $SkipArtifact.IsPresent
|
||||
} -ArgumentList $GuestWorkDir, $BuildCommand, $GuestArtifactZip, $GuestArtifactSource, $UseSharedCache.IsPresent, $ExtraGuestEnv
|
||||
|
||||
if ($buildExit -ne 0) {
|
||||
throw "Build command failed (exit $buildExit)"
|
||||
@@ -534,11 +528,7 @@ try {
|
||||
}
|
||||
}
|
||||
|
||||
if ($SkipArtifact) {
|
||||
Write-Host '[Invoke-RemoteBuild] Build succeeded. Artifact packaging skipped (-SkipArtifact).'
|
||||
} else {
|
||||
Write-Host "[Invoke-RemoteBuild] Build succeeded. Artifact at $GuestArtifactZip"
|
||||
}
|
||||
Write-Host "[Invoke-RemoteBuild] Build succeeded. Artifact at $GuestArtifactZip"
|
||||
}
|
||||
finally {
|
||||
Remove-PSSession $session -ErrorAction SilentlyContinue
|
||||
|
||||
Reference in New Issue
Block a user