|
| 1 | +# ========================================================================================= |
| 2 | +# Local bootstrap for the dual-deploy self-update integration test. |
| 3 | +# |
| 4 | +# Stages a dual-channel local deploy (primary + /v2/) via deploy-local.ps1 -DualPublish, |
| 5 | +# then runs the shared end-to-end test against the next-generation `/v2/` server. Validates |
| 6 | +# that a full update cycle works after the post-migration server URL base change. |
| 7 | +# |
| 8 | +# Optionally accepts -CompatibilityUpdater to substitute an older external-updater binary |
| 9 | +# into the primary channel's manifest (the production migration-release shape). |
| 10 | +# |
| 11 | +# Independent of test-local-update.ps1. |
| 12 | +# |
| 13 | +# Windows-only. |
| 14 | +# ========================================================================================= |
| 15 | + |
| 16 | +#Requires -Version 7.0 |
| 17 | + |
| 18 | +[CmdletBinding()] |
| 19 | +param( |
| 20 | + [string]$InstalledVersion = '0.0.1-local', |
| 21 | + [string]$ServerVersion = '99.99.99-local', |
| 22 | + [string]$Branch = 'beta', |
| 23 | + [string]$CompatibilityUpdater |
| 24 | +) |
| 25 | + |
| 26 | +$ErrorActionPreference = 'Stop' |
| 27 | + |
| 28 | +$root = $PSScriptRoot |
| 29 | +if ([string]::IsNullOrEmpty($root)) { $root = Get-Location } |
| 30 | + |
| 31 | +$deployArgs = @{ |
| 32 | + InstalledVersion = $InstalledVersion |
| 33 | + ServerVersion = $ServerVersion |
| 34 | + DualPublish = $true |
| 35 | +} |
| 36 | +if ($CompatibilityUpdater) { $deployArgs.CompatibilityUpdater = $CompatibilityUpdater } |
| 37 | + |
| 38 | +& (Join-Path $root 'deploy-local.ps1') @deployArgs |
| 39 | +if ($LASTEXITCODE -ne 0) { throw "deploy-local.ps1 -DualPublish failed (exit $LASTEXITCODE)." } |
| 40 | + |
| 41 | +$nextServerDir = Join-Path $root '.local_deploy\server\v2' |
| 42 | +if (-not (Test-Path $nextServerDir)) { |
| 43 | + throw "Expected /v2/ server dir at '$nextServerDir' but it does not exist." |
| 44 | +} |
| 45 | +$nextServerUri = "file:///$(((Resolve-Path $nextServerDir).Path -replace '\\','/'))" |
| 46 | + |
| 47 | +& (Join-Path $root 'modules\ModdingToolBase\scripts\Test-LocalUpdateCycle.ps1') ` |
| 48 | + -AppExePath (Join-Path $root '.local_deploy\install\ModVerify.exe') ` |
| 49 | + -ServerUri $nextServerUri ` |
| 50 | + -Branch $Branch ` |
| 51 | + -NoUpdateMessage 'No update available.' ` |
| 52 | + -ExpectedNewVersion $ServerVersion |
| 53 | + |
| 54 | +exit $LASTEXITCODE |
0 commit comments