9601210baa
gitea/burnin-dummy/build.ps1: Fake build script to commit to the burnin-dummy repo. Creates dist\build-info.txt (date, host, pid) after ~30s ping delay. Invoke-RemoteBuild packages dist\ as artifacts.zip. Start-BurnInTest.ps1: Default BuildCommand updated from ping-only delay to build.ps1 invocation. Run with -NoSkipArtifact to exercise the full artifact pipeline.
34 lines
1021 B
PowerShell
34 lines
1021 B
PowerShell
#Requires -Version 5.1
|
|
<#
|
|
.SYNOPSIS
|
|
Fake build script per il repo burnin-dummy.
|
|
|
|
.DESCRIPTION
|
|
Simula un build reale: attende ~30s (ping), poi scrive un file in dist\.
|
|
Invoke-RemoteBuild impacchetta dist\ come artifacts.zip al termine.
|
|
Committare questo file come build.ps1 nella root del repo burnin-dummy.
|
|
#>
|
|
|
|
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$distDir = Join-Path $PSScriptRoot 'dist'
|
|
if (-not (Test-Path $distDir)) {
|
|
New-Item -ItemType Directory -Path $distDir | Out-Null
|
|
}
|
|
|
|
# Simula lavoro di build (~30 s).
|
|
# ping e' l'unico delay affidabile in contesto cmd/WinRM (Start-Sleep non funziona via cmd /c).
|
|
Write-Host '[build.ps1] Simulating build work (~30s)...'
|
|
ping 127.0.0.1 -n 31 | Out-Null
|
|
|
|
# Scrive un artifact marker con metadati del run.
|
|
@"
|
|
build-ok
|
|
date=$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')
|
|
host=$env:COMPUTERNAME
|
|
pid=$PID
|
|
"@ | Out-File -FilePath (Join-Path $distDir 'build-info.txt') -Encoding UTF8
|
|
|
|
Write-Host "[build.ps1] Artifact written to $distDir"
|