feat(worker): one-command packaging and --check install verification
Deploy / deploy (push) Failing after 15m27s
Deploy / deploy (push) Failing after 15m27s
Adds scripts/publish.ps1, which produces a self-contained single-file exe plus the headless AE build script, optionally zipped for copying to a render machine. Adds `VFXReviewWorker.exe --check`: resolves every configured path, confirms aerender/AfterFX/the build script exist, verifies each pathMappings target is reachable from that machine, and pings the server to confirm the API key is accepted — exiting non-zero if anything would stop the worker running. Catches a wrong path at install time rather than in the logs later. Verified from the published binary: the single-file exe resolves its scripts folder correctly, so the preview build script ships alongside the exe rather than embedded and can be patched without a rebuild. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Packages the RenderWorker for installation on another machine.
|
||||
|
||||
.DESCRIPTION
|
||||
Produces a self-contained single-file build (no .NET runtime needed on the
|
||||
target) plus the headless AE build script, and zips it for copying.
|
||||
|
||||
.EXAMPLE
|
||||
.\publish.ps1
|
||||
.\publish.ps1 -Zip
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$OutDir = "",
|
||||
[switch]$Zip
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$root = Split-Path $PSScriptRoot -Parent
|
||||
if (-not $OutDir) { $OutDir = Join-Path $root "publish\win-x64" }
|
||||
|
||||
Write-Host "Publishing self-contained worker..." -ForegroundColor Cyan
|
||||
& dotnet publish (Join-Path $root "VFXReviewWorker\VFXReviewWorker.csproj") `
|
||||
-c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o $OutDir
|
||||
if ($LASTEXITCODE -ne 0) { throw "dotnet publish failed" }
|
||||
|
||||
# The exe reads scripts\vfxr_build_preview.jsx from its own folder at runtime.
|
||||
$scriptOut = Join-Path $OutDir "scripts\vfxr_build_preview.jsx"
|
||||
if (-not (Test-Path $scriptOut)) { throw "Preview build script missing from output: $scriptOut" }
|
||||
|
||||
Remove-Item (Join-Path $OutDir "*.pdb") -ErrorAction SilentlyContinue
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Package contents:" -ForegroundColor Green
|
||||
Get-ChildItem $OutDir -Recurse -File | ForEach-Object {
|
||||
Write-Host (" {0,-40} {1,8:N0} KB" -f $_.FullName.Substring($OutDir.Length).TrimStart('\'), ($_.Length / 1KB))
|
||||
}
|
||||
|
||||
if ($Zip) {
|
||||
$zipPath = Join-Path $root ("VFXReviewWorker_{0}.zip" -f (Get-Date -Format "yyyyMMdd"))
|
||||
if (Test-Path $zipPath) { Remove-Item $zipPath }
|
||||
Compress-Archive -Path (Join-Path $OutDir "*") -DestinationPath $zipPath
|
||||
Write-Host ""
|
||||
Write-Host "Zipped to: $zipPath" -ForegroundColor Green
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Next on the target machine:" -ForegroundColor Cyan
|
||||
Write-Host " 1. Copy this folder to e.g. C:\pipeline\VFXReviewWorker"
|
||||
Write-Host " 2. Create C:\ProgramData\VFXReviewWorker\config.json (see README)"
|
||||
Write-Host " 3. Verify: .\VFXReviewWorker.exe --check"
|
||||
Write-Host " 4. Install: sc.exe create VFXReviewRenderWorker binPath= ... start= auto obj= ... password= ..."
|
||||
Reference in New Issue
Block a user