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.
63 lines
1.8 KiB
PowerShell
63 lines
1.8 KiB
PowerShell
#Requires -Version 5.1
|
|
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
# Shim: delegates to the Python ci_orchestrator CLI (`artifacts collect`).
|
|
# Original PS implementation moved to git history; see plans/A3-closeout.md.
|
|
#
|
|
# The bound `-Credential` is intentionally discarded — Python uses keyring
|
|
# via `--credential-target` (defaulting to `BuildVMGuest`).
|
|
|
|
[CmdletBinding()]
|
|
param(
|
|
[Parameter(Mandatory)]
|
|
[string] $IPAddress,
|
|
|
|
[Parameter()]
|
|
[System.Management.Automation.PSCredential] $Credential,
|
|
|
|
[Parameter(Mandatory)]
|
|
[string] $GuestArtifactPath,
|
|
|
|
[Parameter(Mandatory)]
|
|
[string] $HostArtifactDir,
|
|
|
|
[switch] $IncludeLogs,
|
|
|
|
[ValidateSet('Windows', 'Linux')]
|
|
[string] $GuestOS = 'Windows',
|
|
|
|
[string] $SshKeyPath = 'F:\CI\keys\ci_linux',
|
|
[string] $SshUser = 'ci_build',
|
|
[string] $SshKnownHostsFile = '',
|
|
|
|
[string] $JobId = '',
|
|
[string] $Commit = '',
|
|
|
|
[string] $CredentialTarget = ''
|
|
)
|
|
|
|
$pyArgs = @(
|
|
'--ip-address', $IPAddress,
|
|
'--guest-os', $GuestOS.ToLower(),
|
|
'--guest-artifact-path', $GuestArtifactPath,
|
|
'--host-artifact-dir', $HostArtifactDir,
|
|
'--ssh-user', $SshUser,
|
|
'--ssh-key-path', $SshKeyPath,
|
|
'--job-id', $JobId,
|
|
'--commit', $Commit
|
|
)
|
|
|
|
if ($SshKnownHostsFile) { $pyArgs += @('--ssh-known-hosts-file', $SshKnownHostsFile) }
|
|
if ($CredentialTarget) { $pyArgs += @('--credential-target', $CredentialTarget) }
|
|
if ($IncludeLogs.IsPresent) { $pyArgs += '--include-logs' }
|
|
|
|
if ($Credential) {
|
|
Write-Host '[Get-BuildArtifacts] -Credential ignored; Python CLI uses keyring (set -CredentialTarget to override target name).'
|
|
}
|
|
|
|
$venvPython = $env:CI_VENV_PYTHON
|
|
if (-not $venvPython) { $venvPython = 'F:\CI\python\venv\Scripts\python.exe' }
|
|
& $venvPython -m ci_orchestrator artifacts collect @pyArgs
|
|
exit $LASTEXITCODE
|