mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-09-03 18:55:33 +00:00
feat: support -Version for -Provision and -Cleanup commands
Provision and cleanup now accept a version argument (8, 9, or all) to operate on a subset of PVE nodes: dev.ps1 -Provision -Version 9 -DockerHost ... # only PVE 9 nodes dev.ps1 -Cleanup -Version 8 -DockerHost ... # only PVE 8 nodes run-integration.sh provision/cleanup also accept the version arg, overriding PVE_VERSIONS and ALL_NODES for that invocation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -229,7 +229,7 @@ if ($Test) {
|
|||||||
|
|
||||||
if ($Provision) {
|
if ($Provision) {
|
||||||
Start-InfraContainer
|
Start-InfraContainer
|
||||||
docker exec $InfraContainer bash $RunIntegration provision
|
docker exec $InfraContainer bash $RunIntegration provision $Version
|
||||||
if ($LASTEXITCODE -ne 0) { throw "Provisioning failed (exit code $LASTEXITCODE)" }
|
if ($LASTEXITCODE -ne 0) { throw "Provisioning failed (exit code $LASTEXITCODE)" }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ if ($Integration) {
|
|||||||
|
|
||||||
if ($Cleanup) {
|
if ($Cleanup) {
|
||||||
Start-InfraContainer
|
Start-InfraContainer
|
||||||
docker exec $InfraContainer bash $RunIntegration cleanup
|
docker exec $InfraContainer bash $RunIntegration cleanup $Version
|
||||||
if ($LASTEXITCODE -ne 0) { throw "Cleanup failed (exit code $LASTEXITCODE)" }
|
if ($LASTEXITCODE -ne 0) { throw "Cleanup failed (exit code $LASTEXITCODE)" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
# Docker containers on the runner host for iSCSI/NFS shared storage.
|
# Docker containers on the runner host for iSCSI/NFS shared storage.
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# run-integration.sh provision Provision nested PVE VMs + start storage containers
|
# run-integration.sh provision [8|9|all] Provision nested PVE VMs + start storage containers
|
||||||
# run-integration.sh test [8|9|all] [filter] Run integration tests (default: all, no filter)
|
# run-integration.sh test [8|9|all] [filter] Run integration tests (default: all, no filter)
|
||||||
# run-integration.sh cleanup Destroy provisioned VMs
|
# run-integration.sh cleanup [8|9|all] Destroy provisioned VMs
|
||||||
# run-integration.sh all [8|9|all] Full lifecycle: provision → test → cleanup
|
# run-integration.sh all [8|9|all] Full lifecycle: provision → test → cleanup
|
||||||
#
|
#
|
||||||
# The optional [filter] is a comma-separated list of test area names.
|
# The optional [filter] is a comma-separated list of test area names.
|
||||||
@@ -116,6 +116,11 @@ require_env() {
|
|||||||
# ── Subcommands ─────────────────────────────────────────────────────
|
# ── Subcommands ─────────────────────────────────────────────────────
|
||||||
|
|
||||||
cmd_provision() {
|
cmd_provision() {
|
||||||
|
local requested="${1:-all}"
|
||||||
|
if [[ "$requested" != "all" ]]; then
|
||||||
|
PVE_VERSIONS="$requested"
|
||||||
|
ALL_NODES="$(expand_nodes)"
|
||||||
|
fi
|
||||||
log "Starting provisioning..."
|
log "Starting provisioning..."
|
||||||
log " Versions: $PVE_VERSIONS"
|
log " Versions: $PVE_VERSIONS"
|
||||||
log " Nodes: $ALL_NODES"
|
log " Nodes: $ALL_NODES"
|
||||||
@@ -444,6 +449,11 @@ cmd_test() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd_cleanup() {
|
cmd_cleanup() {
|
||||||
|
local requested="${1:-all}"
|
||||||
|
if [[ "$requested" != "all" ]]; then
|
||||||
|
PVE_VERSIONS="$requested"
|
||||||
|
ALL_NODES="$(expand_nodes)"
|
||||||
|
fi
|
||||||
log "Starting cleanup..."
|
log "Starting cleanup..."
|
||||||
|
|
||||||
# Clean up PVE nodes
|
# Clean up PVE nodes
|
||||||
@@ -495,9 +505,9 @@ main() {
|
|||||||
echo "Usage: $(basename "$0") {provision|test|cleanup|all} [8|9|all] [test-filter]"
|
echo "Usage: $(basename "$0") {provision|test|cleanup|all} [8|9|all] [test-filter]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Subcommands:"
|
echo "Subcommands:"
|
||||||
echo " provision Provision nested PVE VMs + start storage containers"
|
echo " provision [8|9|all] Provision nested PVE VMs + start storage containers"
|
||||||
echo " test [8|9|all] [filter] Run integration tests (default: all versions, no filter)"
|
echo " test [8|9|all] [filter] Run integration tests (default: all versions, no filter)"
|
||||||
echo " cleanup Destroy all provisioned VMs"
|
echo " cleanup [8|9|all] Destroy provisioned VMs (default: all)"
|
||||||
echo " all [8|9|all] Full lifecycle: provision → test → cleanup"
|
echo " all [8|9|all] Full lifecycle: provision → test → cleanup"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Test filter: comma-separated area names matching test filenames."
|
echo "Test filter: comma-separated area names matching test filenames."
|
||||||
|
|||||||
Reference in New Issue
Block a user