fix(burn-in): create placeholder artifact when build command produces no output dir
Invoke-RemoteBuild.ps1: when BuildCommand succeeds (exit 0) but GuestArtifactSource (default: dist) does not exist, instead of silently skipping packaging, now creates a placeholder 'build-ok.txt' in the artifact output dir and zips it. This ensures Get-BuildArtifacts.ps1 always finds artifacts.zip regardless of whether the build produced real output files. Correct for burn-in, smoke, and delay-only build commands. Start-BurnInTest.ps1: revert default BuildCommand to 'ping 127.0.0.1 -n 31 > nul' (~30s delay, no artifact output) now that the pipeline handles missing dist gracefully. The previous 'if not exist dist mkdir dist' workaround is no longer needed.
This commit is contained in:
@@ -449,7 +449,14 @@ try {
|
||||
}
|
||||
$srcPath = Join-Path $workDir $artifactSrc
|
||||
if (-not (Test-Path $srcPath)) {
|
||||
Write-Host "[Build] Artifact source '$srcPath' not found — skipping packaging."
|
||||
# No artifact source — create a placeholder zip so that
|
||||
# Get-BuildArtifacts succeeds and the full pipeline is exercised.
|
||||
# This is expected for burn-in / smoke builds that produce no output.
|
||||
Write-Host "[Build] Artifact source '$srcPath' not found — creating placeholder artifact."
|
||||
$placeholder = Join-Path $archiveDir 'build-ok.txt'
|
||||
'No artifact source directory. Build command completed successfully.' |
|
||||
Out-File -FilePath $placeholder -Encoding UTF8
|
||||
Compress-Archive -Path $placeholder -DestinationPath $artifactZip -Force
|
||||
}
|
||||
else {
|
||||
$7zip = 'C:\Program Files\7-Zip\7z.exe'
|
||||
|
||||
Reference in New Issue
Block a user