816a15503e
Implements Phase A3 of plans/implementation-plan-A-B.md:
- commands/vm.py: vm new (replaces New-BuildVM.ps1)
- commands/build.py: build run (replaces Invoke-RemoteBuild.ps1) with WinRM/SSH dispatch and stdout streaming for act_runner
- commands/artifacts.py: artifacts collect (replaces Get-BuildArtifacts.ps1) using transport.fetch()
- 3 PS scripts reduced to shims preserving \0
- Pester tests/{New-BuildVM,Wait-VMReady,Remove-BuildVM}.Tests.ps1 removed; equivalent cases covered in pytest
- Phase C hook: build/artifacts accept opaque VmHandle/vmx; no Windows path assumptions
Tests: 91 pytest, ruff clean, mypy --strict clean, coverage 78.27% (>=70 gate).
Master checklist + step A3 attivita + 'definizione di fatto' updated; A3-closeout.md added.
37 lines
968 B
PowerShell
37 lines
968 B
PowerShell
#Requires -Version 5.1
|
|
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
# Shim: delegates to the Python ci_orchestrator CLI (`vm new`).
|
|
# Original PS implementation moved to git history; see plans/A3-closeout.md.
|
|
|
|
[CmdletBinding()]
|
|
param(
|
|
[Parameter(Mandatory)]
|
|
[ValidateScript({ Test-Path $_ -PathType Leaf })]
|
|
[string] $TemplatePath,
|
|
|
|
[string] $SnapshotName = 'BaseClean',
|
|
|
|
[Parameter(Mandatory)]
|
|
[string] $CloneBaseDir,
|
|
|
|
[Parameter(Mandatory)]
|
|
[string] $JobId,
|
|
|
|
[string] $VmrunPath = 'C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe'
|
|
)
|
|
|
|
$pyArgs = @(
|
|
'--template-path', $TemplatePath,
|
|
'--snapshot-name', $SnapshotName,
|
|
'--clone-base-dir', $CloneBaseDir,
|
|
'--job-id', $JobId,
|
|
'--vmrun-path', $VmrunPath
|
|
)
|
|
|
|
$venvPython = $env:CI_VENV_PYTHON
|
|
if (-not $venvPython) { $venvPython = 'F:\CI\python\venv\Scripts\python.exe' }
|
|
& $venvPython -m ci_orchestrator vm new @pyArgs
|
|
exit $LASTEXITCODE
|