mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
add local-sign variant to baosign.ps1
This commit is contained in:
parent
0c23c5e5bc
commit
aaad119bcc
1 changed files with 31 additions and 21 deletions
14
baosign.ps1
14
baosign.ps1
|
|
@ -16,7 +16,10 @@ param(
|
||||||
[string]$CredentialFile = "beta.json",
|
[string]$CredentialFile = "beta.json",
|
||||||
|
|
||||||
[Parameter(Mandatory = $false)]
|
[Parameter(Mandatory = $false)]
|
||||||
[string]$Target = "bunnie@10.0.245.50:code/csp-tool/"
|
[string]$Target = "bunnie@10.0.245.50:code/csp-tool/",
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[switch]$Local
|
||||||
)
|
)
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
|
|
@ -193,6 +196,7 @@ foreach ($imageSpec in $selectedConfig) {
|
||||||
|
|
||||||
Write-Status "Signing image..."
|
Write-Status "Signing image..."
|
||||||
Write-Status "Command: $($cargoCmd -join ' ')"
|
Write-Status "Command: $($cargoCmd -join ' ')"
|
||||||
|
Write-Status "Target SSH: $(if ($Local) { '(skipped, --Local mode)' } else { $TARGET })"
|
||||||
|
|
||||||
# Execute the signing command
|
# Execute the signing command
|
||||||
& cargo run -- --credential-file "..\credentials\$CredentialFile" --file "..\..\$imagePath" --function-code $functionCode 2>&1 | Tee-Object -Variable result
|
& cargo run -- --credential-file "..\credentials\$CredentialFile" --file "..\..\$imagePath" --function-code $functionCode 2>&1 | Tee-Object -Variable result
|
||||||
|
|
@ -218,6 +222,12 @@ foreach ($imageSpec in $selectedConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Copy files to SSH target
|
# Copy files to SSH target
|
||||||
|
if ($Local) {
|
||||||
|
Write-Warning "Skipping remote copy (--Local flag set)"
|
||||||
|
Write-Success "Completed processing: $imageName"
|
||||||
|
$successfulImages++
|
||||||
|
}
|
||||||
|
else {
|
||||||
Write-Status "Copying files to remote host..."
|
Write-Status "Copying files to remote host..."
|
||||||
|
|
||||||
$imgCopySuccess = Copy-ToSSH -LocalPath $imagePath -RemoteTarget $TARGET
|
$imgCopySuccess = Copy-ToSSH -LocalPath $imagePath -RemoteTarget $TARGET
|
||||||
|
|
@ -231,7 +241,7 @@ foreach ($imageSpec in $selectedConfig) {
|
||||||
Write-Warning "Partial completion for: $imageName (signing OK, copy failed)"
|
Write-Warning "Partial completion for: $imageName (signing OK, copy failed)"
|
||||||
$failedImages++
|
$failedImages++
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Error "Failed to sign image: $imageName"
|
Write-Error "Failed to sign image: $imageName"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue