test(render): add connected package lifecycle gate
This commit is contained in:
parent
1f75ce0505
commit
f92479ac3e
4 changed files with 507 additions and 12 deletions
|
|
@ -168,7 +168,9 @@ function New-ConnectedGraphicalSessionConfig {
|
|||
[string]$HostName = '127.0.0.1',
|
||||
[ValidateRange(1, 65535)][int]$Port = 9000,
|
||||
[ValidateRange(0, [int]::MaxValue)][int]$CharacterIndex = 0,
|
||||
[string]$CredentialEnvironmentVariable = 'ACDREAM_TEST_PASS'
|
||||
[string]$CredentialEnvironmentVariable = 'ACDREAM_TEST_PASS',
|
||||
[string[]]$Plugins = @(),
|
||||
[string]$StatusFile
|
||||
)
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($Account)) {
|
||||
|
|
@ -187,18 +189,36 @@ function New-ConnectedGraphicalSessionConfig {
|
|||
throw "Connected graphical session config already exists: '$path'."
|
||||
}
|
||||
|
||||
$session = [ordered]@{
|
||||
id = 'connected-gate'
|
||||
endpoint = [ordered]@{ host = $HostName; port = $Port }
|
||||
account = $Account
|
||||
character = [ordered]@{ index = $CharacterIndex }
|
||||
credential = [ordered]@{
|
||||
provider = 'Environment'
|
||||
reference = $CredentialEnvironmentVariable
|
||||
}
|
||||
}
|
||||
if ($PSBoundParameters.ContainsKey('Plugins')) {
|
||||
$orderedPlugins = @($Plugins | ForEach-Object {
|
||||
if ([string]::IsNullOrWhiteSpace($_)) {
|
||||
throw 'Connected graphical session plugin IDs cannot be empty.'
|
||||
}
|
||||
$_
|
||||
} | Sort-Object -Unique)
|
||||
$session['plugins'] = $orderedPlugins
|
||||
}
|
||||
if ($PSBoundParameters.ContainsKey('StatusFile')) {
|
||||
if ([string]::IsNullOrWhiteSpace($StatusFile)) {
|
||||
throw 'Connected graphical session status file cannot be empty.'
|
||||
}
|
||||
$session['statusFile'] = Assert-ConnectedGateContainedPath `
|
||||
$State.StateDirectory $StatusFile
|
||||
}
|
||||
|
||||
[ordered]@{
|
||||
version = 1
|
||||
sessions = @([ordered]@{
|
||||
id = 'connected-gate'
|
||||
endpoint = [ordered]@{ host = $HostName; port = $Port }
|
||||
account = $Account
|
||||
character = [ordered]@{ index = $CharacterIndex }
|
||||
credential = [ordered]@{
|
||||
provider = 'Environment'
|
||||
reference = $CredentialEnvironmentVariable
|
||||
}
|
||||
})
|
||||
sessions = @($session)
|
||||
} | ConvertTo-Json -Depth 8 |
|
||||
Set-Content -LiteralPath $path -Encoding utf8
|
||||
return $path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue