From 9601210baa3ab752c8a4c96e31cdeebc7609fbe9 Mon Sep 17 00:00:00 2001 From: Simone Date: Tue, 12 May 2026 21:55:38 +0200 Subject: [PATCH] feat(burn-in): add fake build script for burnin-dummy repo; update default BuildCommand 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. --- gitea/burnin-dummy/build.ps1 | 33 +++++++++++++++++++++++++++++++++ scripts/Start-BurnInTest.ps1 | 4 ++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 gitea/burnin-dummy/build.ps1 diff --git a/gitea/burnin-dummy/build.ps1 b/gitea/burnin-dummy/build.ps1 new file mode 100644 index 0000000..9704a50 --- /dev/null +++ b/gitea/burnin-dummy/build.ps1 @@ -0,0 +1,33 @@ +#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" diff --git a/scripts/Start-BurnInTest.ps1 b/scripts/Start-BurnInTest.ps1 index 73a3e7c..149e096 100644 --- a/scripts/Start-BurnInTest.ps1 +++ b/scripts/Start-BurnInTest.ps1 @@ -48,7 +48,7 @@ param( [int] $Rounds = 3, [int] $Parallelism = 4, - [string] $BuildCommand = 'ping 127.0.0.1 -n 31 > nul', + [string] $BuildCommand = 'powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File build.ps1', [switch] $NoSkipArtifact, [int] $RoundTimeoutMinutes = 60 ) @@ -59,7 +59,7 @@ $ErrorActionPreference = 'Stop' $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path $burnInParams = @{ - RepoUrl = 'http://10.10.20.11:3100/ci/burnin-dummy.git' + RepoUrl = 'https://gitea.emulab.it/Simone/burnin-dummy.git' Branch = 'main' TemplatePath = 'F:\CI\Templates\WinBuild2025\WinBuild2025.vmx' SnapshotName = 'BaseClean'