feat(launcher): complete Campaign LA11 pre-gate support
This commit is contained in:
parent
f881e5b467
commit
134edabed2
19 changed files with 433 additions and 55 deletions
|
|
@ -85,9 +85,11 @@ foreach ($release in @('A', 'B')) {
|
|||
Require-PayloadFile "$release-client-win-x64" 'AcDream.App.exe'
|
||||
Require-PayloadFile "$release-client-win-x64" 'acdream-headless.exe'
|
||||
Require-PayloadFile "$release-launcher-win-x64" 'acdream-launcher.exe'
|
||||
Require-PayloadFile "$release-launcher-win-x64" 'acdream-bake.exe'
|
||||
Require-PayloadFile "$release-client-linux-x64" 'AcDream.App'
|
||||
Require-PayloadFile "$release-client-linux-x64" 'acdream-headless'
|
||||
Require-PayloadFile "$release-launcher-linux-x64" 'acdream-launcher'
|
||||
Require-PayloadFile "$release-launcher-linux-x64" 'acdream-bake'
|
||||
}
|
||||
|
||||
if (Test-Path -LiteralPath $OutputDirectory) {
|
||||
|
|
@ -155,6 +157,7 @@ function New-DeterministicZip(
|
|||
$executable = $relative -ceq 'AcDream.App' -or
|
||||
$relative -ceq 'acdream-headless' -or
|
||||
$relative -ceq 'acdream-launcher' -or
|
||||
$relative -ceq 'acdream-bake' -or
|
||||
$relative.EndsWith('.sh', [StringComparison]::Ordinal)
|
||||
$mode = if ($executable) { 0x81ED } else { 0x81A4 }
|
||||
$entry.ExternalAttributes = $mode -shl 16
|
||||
|
|
@ -239,16 +242,26 @@ $server = @'
|
|||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory = $true)][string]$Root,
|
||||
[Parameter(Mandatory = $true)][int]$Port
|
||||
[Parameter(Mandatory = $true)][int]$Port,
|
||||
[ValidateRange(0, 1000000)][int]$MaximumRequests = 0
|
||||
)
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$expectedRoot = [IO.Path]::TrimEndingDirectorySeparator(
|
||||
[IO.Path]::GetFullPath($PSScriptRoot))
|
||||
$Root = [IO.Path]::TrimEndingDirectorySeparator([IO.Path]::GetFullPath($Root))
|
||||
$pathComparison = if ($IsWindows) {
|
||||
[StringComparison]::OrdinalIgnoreCase
|
||||
} else { [StringComparison]::Ordinal }
|
||||
if (-not [string]::Equals($Root, $expectedRoot, $pathComparison)) {
|
||||
throw '-Root must be the directory containing serve-fixture.ps1.'
|
||||
}
|
||||
$prefix = "http://127.0.0.1:$Port/"
|
||||
$listener = [Net.HttpListener]::new()
|
||||
$listener.Prefixes.Add($prefix)
|
||||
$listener.Start()
|
||||
Write-Host "Campaign LA fixture listening on $prefix"
|
||||
$servedRequests = 0
|
||||
try {
|
||||
while ($listener.IsListening) {
|
||||
$context = $listener.GetContext()
|
||||
|
|
@ -287,7 +300,13 @@ try {
|
|||
$context.Response.StatusCode = 500
|
||||
Write-Error $_
|
||||
}
|
||||
finally { $context.Response.Close() }
|
||||
finally {
|
||||
$context.Response.Close()
|
||||
$servedRequests++
|
||||
}
|
||||
if ($MaximumRequests -gt 0 -and $servedRequests -ge $MaximumRequests) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
finally { $listener.Close() }
|
||||
|
|
@ -301,8 +320,24 @@ param(
|
|||
[string]$Root = $PSScriptRoot
|
||||
)
|
||||
Set-StrictMode -Version Latest
|
||||
$path = Join-Path ([IO.Path]::GetFullPath($Root)) 'active-release.txt'
|
||||
Set-Content -LiteralPath $path -Value $Release -Encoding ascii -NoNewline
|
||||
$expectedRoot = [IO.Path]::TrimEndingDirectorySeparator(
|
||||
[IO.Path]::GetFullPath($PSScriptRoot))
|
||||
$Root = [IO.Path]::TrimEndingDirectorySeparator([IO.Path]::GetFullPath($Root))
|
||||
$pathComparison = if ($IsWindows) {
|
||||
[StringComparison]::OrdinalIgnoreCase
|
||||
} else { [StringComparison]::Ordinal }
|
||||
if (-not [string]::Equals($Root, $expectedRoot, $pathComparison)) {
|
||||
throw '-Root must be the directory containing set-active-release.ps1.'
|
||||
}
|
||||
$path = Join-Path $Root 'active-release.txt'
|
||||
$temporary = "$path.$([Guid]::NewGuid().ToString('N')).tmp"
|
||||
try {
|
||||
[IO.File]::WriteAllText($temporary, $Release, [Text.Encoding]::ASCII)
|
||||
[IO.File]::Move($temporary, $path, $true)
|
||||
}
|
||||
finally {
|
||||
if ([IO.File]::Exists($temporary)) { [IO.File]::Delete($temporary) }
|
||||
}
|
||||
Write-Host "Campaign LA fixture active release: $Release"
|
||||
'@
|
||||
$selector | Set-Content -LiteralPath (Join-Path $OutputDirectory 'set-active-release.ps1') -Encoding utf8NoBOM
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue