feat(deploy/windows): always deploy the plugin/script runner
`punktfunk-host plugins add/remove/list` forward to the bun runner, which on
Windows is resolved relative to the running exe (<exe-dir>\bun\bun.exe +
<exe-dir>\scripting\runner-cli.js). Only the installer ever laid that payload
down, so on a deploy-host.ps1 dev box — where the service runs out of
target\release — both paths are absent and the CLI bails with "the plugin
runner isn't installed". deploy-all.ps1 was host + web console only.
Add build-scripting.ps1: it mirrors CI (bun install --frozen-lockfile
--ignore-scripts + bun build src/runner-cli.ts --target=bun, gated on the same
`attempt=` sentinel that proves the dynamic plugin import stayed a runtime
import), then lays the bundle + scripting-run.cmd + the shared bun next to every
host exe it finds — the built one and whatever the PunktfunkHost service runs —
so it is correct on a dev checkout or an installed {app}. It stops a running
PunktfunkScripting first (a live runner holds bun.exe open) and does not
silently enable the opt-in task (-EnableTask to do so).
deploy-all.ps1 is now host -> web console -> runner, always, so the host binary
and the runner bundle never drift apart.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,26 +1,40 @@
|
||||
<#
|
||||
Rebuild + redeploy everything: the Windows host service AND the web management console.
|
||||
Thin wrapper around deploy-host.ps1 + build-web.ps1 - see scripts\windows\README.md for what
|
||||
each one does on its own (rollback behavior, build env, etc).
|
||||
Rebuild + redeploy everything: the Windows host service, the web management console AND the
|
||||
plugin/script runner. Thin wrapper around deploy-host.ps1 + build-web.ps1 + build-scripting.ps1 -
|
||||
see scripts\windows\README.md for what each one does on its own (rollback behavior, build env, etc).
|
||||
|
||||
powershell -ExecutionPolicy Bypass -File scripts\windows\deploy-all.ps1
|
||||
powershell -ExecutionPolicy Bypass -File scripts\windows\deploy-all.ps1 -EnableScriptingTask
|
||||
|
||||
All three modules are ALWAYS deployed - a host binary whose runner bundle is stale (or missing)
|
||||
fails `punktfunk-host plugins add` outright, since the CLI forwards package ops to the runner it
|
||||
finds next to the exe.
|
||||
|
||||
Run from an elevated PowerShell. deploy-host.ps1 throws (and rolls itself back) on a failed
|
||||
build/start, which stops this script before the web console step runs.
|
||||
build/start, which stops this script before the later steps run.
|
||||
#>
|
||||
param(
|
||||
[switch]$EnableScriptingTask # forwarded to build-scripting.ps1 (opt-in task)
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$here = $PSScriptRoot
|
||||
|
||||
Write-Host "=========================================="
|
||||
Write-Host " 1/2 host service"
|
||||
Write-Host " 1/3 host service"
|
||||
Write-Host "=========================================="
|
||||
& (Join-Path $here 'deploy-host.ps1')
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "=========================================="
|
||||
Write-Host " 2/2 web console"
|
||||
Write-Host " 2/3 web console"
|
||||
Write-Host "=========================================="
|
||||
& (Join-Path $here 'build-web.ps1')
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DONE - host + web console redeployed."
|
||||
Write-Host "=========================================="
|
||||
Write-Host " 3/3 plugin/script runner"
|
||||
Write-Host "=========================================="
|
||||
& (Join-Path $here 'build-scripting.ps1') -EnableTask:$EnableScriptingTask
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DONE - host + web console + plugin runner redeployed."
|
||||
|
||||
Reference in New Issue
Block a user