fix: include rendering gate in NAS manifest
This commit is contained in:
@@ -24,6 +24,34 @@ function Quote-Sh {
|
|||||||
return "'" + ($Value -replace "'", "'\''") + "'"
|
return "'" + ($Value -replace "'", "'\''") + "'"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-ObjectPropertyValue {
|
||||||
|
param(
|
||||||
|
[object]$Object,
|
||||||
|
[string]$Name
|
||||||
|
)
|
||||||
|
if ($null -eq $Object) {
|
||||||
|
return $null
|
||||||
|
}
|
||||||
|
$property = $Object.PSObject.Properties[$Name]
|
||||||
|
if ($null -eq $property) {
|
||||||
|
return $null
|
||||||
|
}
|
||||||
|
return $property.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
function Test-ReleaseManifestRenderingGate {
|
||||||
|
param([object]$Manifest)
|
||||||
|
$renderingGate = Get-ObjectPropertyValue $Manifest "renderingGate"
|
||||||
|
$viewport = Get-ObjectPropertyValue $renderingGate "viewport"
|
||||||
|
return (
|
||||||
|
(Get-ObjectPropertyValue $renderingGate "requiredRenderer") -eq "webgl" -and
|
||||||
|
(Get-ObjectPropertyValue $renderingGate "compatibilityRenderer") -eq "canvas" -and
|
||||||
|
(Get-ObjectPropertyValue $viewport "width") -eq 1920 -and
|
||||||
|
(Get-ObjectPropertyValue $viewport "height") -eq 1080 -and
|
||||||
|
(Get-ObjectPropertyValue $viewport "deviceScaleFactor") -eq 1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
Assert-Command "ssh"
|
Assert-Command "ssh"
|
||||||
Assert-Command "scp"
|
Assert-Command "scp"
|
||||||
Assert-Command "git"
|
Assert-Command "git"
|
||||||
@@ -64,9 +92,14 @@ if (Test-Path $releaseManifestPath -PathType Leaf) {
|
|||||||
if ($existingReleaseManifest.app -ne "heros_web") {
|
if ($existingReleaseManifest.app -ne "heros_web") {
|
||||||
throw "Existing release manifest has unexpected app '$($existingReleaseManifest.app)'."
|
throw "Existing release manifest has unexpected app '$($existingReleaseManifest.app)'."
|
||||||
}
|
}
|
||||||
if ($existingReleaseManifest.commit -eq $fullCommit) {
|
if (
|
||||||
|
$existingReleaseManifest.commit -eq $fullCommit -and
|
||||||
|
(Test-ReleaseManifestRenderingGate $existingReleaseManifest)
|
||||||
|
) {
|
||||||
$writeReleaseManifest = $false
|
$writeReleaseManifest = $false
|
||||||
Write-Host "Using existing $releaseManifestPath for $commit"
|
Write-Host "Using existing $releaseManifestPath for $commit"
|
||||||
|
} elseif ($existingReleaseManifest.commit -eq $fullCommit) {
|
||||||
|
Write-Host "Replacing incomplete $releaseManifestPath for $commit"
|
||||||
} else {
|
} else {
|
||||||
Write-Host "Replacing stale $releaseManifestPath commit $($existingReleaseManifest.commit) with $commit"
|
Write-Host "Replacing stale $releaseManifestPath commit $($existingReleaseManifest.commit) with $commit"
|
||||||
}
|
}
|
||||||
@@ -81,6 +114,15 @@ if ($writeReleaseManifest) {
|
|||||||
shortCommit = $commit
|
shortCommit = $commit
|
||||||
qaVersion = $qaVersion
|
qaVersion = $qaVersion
|
||||||
generatedAt = (Get-Date).ToUniversalTime().ToString("o")
|
generatedAt = (Get-Date).ToUniversalTime().ToString("o")
|
||||||
|
renderingGate = @{
|
||||||
|
requiredRenderer = "webgl"
|
||||||
|
compatibilityRenderer = "canvas"
|
||||||
|
viewport = @{
|
||||||
|
width = 1920
|
||||||
|
height = 1080
|
||||||
|
deviceScaleFactor = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
} | ConvertTo-Json -Depth 4
|
} | ConvertTo-Json -Depth 4
|
||||||
$utf8NoBom = New-Object System.Text.UTF8Encoding $false
|
$utf8NoBom = New-Object System.Text.UTF8Encoding $false
|
||||||
[System.IO.File]::WriteAllText($releaseManifestPath, "$releaseManifestJson`n", $utf8NoBom)
|
[System.IO.File]::WriteAllText($releaseManifestPath, "$releaseManifestJson`n", $utf8NoBom)
|
||||||
|
|||||||
Reference in New Issue
Block a user