scripts+docs: Refresh-Services.ps1 for alarm-rig deploy refresh (PR D.1) #417

Merged
dohertj2 merged 1 commits from track-d1-refresh-services into master 2026-04-30 21:14:00 -04:00
Owner

Summary

Seventeenth PR of the alarms-over-gateway epic. Lands the deploy automation Track D calls for. The actual smoke-run (publish, restart, fire alarms, capture artifacts) remains operator work; this PR ships the automation the operator drives.

scripts/install/Refresh-Services.ps1:

  • Stops services in reverse-dependency order (OtOpcUaOtOpcUaWonderwareHistorianMxAccessGw) and force-kills any residual processes (avoids the publish-time MSB3027 file-lock the original install script hit).
  • Snapshots existing C:\publish trees to C:\publish\.backup-YYYY-MM-DD-HHMMSS\ for rollback (skip with -SkipBackup).
  • Builds + copies mxaccessgw worker (x86 net48) + server (net10.0) binaries.
  • Publishes OtOpcUa Server + Wonderware historian sidecar.
  • Ensures OTOPCUA_HISTORIAN_ALARM_WRITE_ENABLED=true is set on the historian service env block (PR C.2 toggle).
  • Starts services in forward-dependency order with the inter-service waits the original install used.
  • Smoke-verifies (service status, ports 5120/4840/4841, recent log tails).
  • Supports -WhatIf for dry-run.

docs/v2/dev-environment.md adds a "Service Refresh" section that documents the script + cross-references the plan's Track D functional verification scenarios.

Test plan

  • Script lints clean under PowerShell strict mode
  • Operator runs the script on DESKTOP-6JL3KKO and captures docs/plans/artifacts/d1-rollout-YYYY-MM-DD.md with smoke-test output (gated on PR A.2's worker-side MxAccess subscription landing — without A.2 the alarm-raise scenario can't be validated end-to-end)

The script can ship today and the smoke-run artifact lands as a follow-up commit once A.2 is hardware-verified.

## Summary Seventeenth PR of the **alarms-over-gateway** epic. Lands the deploy automation Track D calls for. The actual smoke-run (publish, restart, fire alarms, capture artifacts) remains operator work; this PR ships the automation the operator drives. `scripts/install/Refresh-Services.ps1`: - Stops services in reverse-dependency order (`OtOpcUa` → `OtOpcUaWonderwareHistorian` → `MxAccessGw`) and force-kills any residual processes (avoids the publish-time `MSB3027` file-lock the original install script hit). - Snapshots existing `C:\publish` trees to `C:\publish\.backup-YYYY-MM-DD-HHMMSS\` for rollback (skip with `-SkipBackup`). - Builds + copies mxaccessgw worker (x86 net48) + server (net10.0) binaries. - Publishes OtOpcUa Server + Wonderware historian sidecar. - Ensures `OTOPCUA_HISTORIAN_ALARM_WRITE_ENABLED=true` is set on the historian service env block (PR C.2 toggle). - Starts services in forward-dependency order with the inter-service waits the original install used. - Smoke-verifies (service status, ports 5120/4840/4841, recent log tails). - Supports `-WhatIf` for dry-run. `docs/v2/dev-environment.md` adds a "Service Refresh" section that documents the script + cross-references the plan's Track D functional verification scenarios. ## Test plan - [x] Script lints clean under PowerShell strict mode - [ ] Operator runs the script on `DESKTOP-6JL3KKO` and captures `docs/plans/artifacts/d1-rollout-YYYY-MM-DD.md` with smoke-test output (gated on PR A.2's worker-side MxAccess subscription landing — without A.2 the alarm-raise scenario can't be validated end-to-end) The script can ship today and the smoke-run artifact lands as a follow-up commit once A.2 is hardware-verified.
dohertj2 added 1 commit 2026-04-30 21:13:56 -04:00
Seventeenth PR of the alarms-over-gateway epic
(docs/plans/alarms-over-gateway.md). Lands the script that the
plan calls for in Track D — the actual smoke-run validation
on the dev rig (publish, restart, fire alarms, capture artifacts)
remains operator work; this PR ships the automation that the
operator drives.

scripts/install/Refresh-Services.ps1 — single-shot refresh
script. Designed to run elevated on the deploy host
(DESKTOP-6JL3KKO today; production uses a separate runbook).
The script:

- Stops services in reverse-dependency order (OtOpcUa →
  OtOpcUaWonderwareHistorian → MxAccessGw) and force-kills any
  residual processes (avoids the publish-time MSB3027 file-lock
  the original install script hit).
- Snapshots existing C:\publish trees to
  C:\publish\.backup-YYYY-MM-DD-HHMMSS\ for rollback (skip with
  -SkipBackup).
- Builds + copies mxaccessgw worker (x86 net48) + server (net10.0)
  binaries from the sibling repo.
- Publishes OtOpcUa Server + Wonderware historian sidecar from
  this repo.
- Ensures OTOPCUA_HISTORIAN_ALARM_WRITE_ENABLED=true is set on
  the historian service env block (PR C.2 toggle).
- Starts services in forward-dependency order with the
  inter-service waits the original install used.
- Smoke-verifies (service status, listening ports 5120 / 4840
  / 4841, recent log tails).

Supports -WhatIf for dry-run inspection without touching the
running services.

docs/v2/dev-environment.md — new "Service Refresh —
Refresh-Services.ps1" section between Credential Management
and Test Data Seed. Cross-references the plan's Track D
functional verification scenarios.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit 439b39463b into master 2026-04-30 21:14:00 -04:00
dohertj2 deleted branch track-d1-refresh-services 2026-04-30 21:14:00 -04:00
Sign in to join this conversation.