Skip to content

Commit 32a2638

Browse files
author
DavidQ
committed
Adds a meaningful deploy-operations layer with post-deploy verification, monitoring/logging expectations, clearer operator messaging, and rollback/abort guidance so the Docker deployment flow is easier to validate and run.
BUILD_PR_LEVEL_09_31_DEPLOY_MONITORING_AND_OPERATIONS
1 parent 071f467 commit 32a2638

12 files changed

Lines changed: 333 additions & 11 deletions

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
.DS_Store
88
*.log
99

10-
# Ignore the docs directory
11-
/*.zip
10+
# Ignore all files in the tmp directory
1211
/tmp/*
12+
13+
# Ignore zip files and temporary files
14+
/*.zip
15+
16+
# Ignore specific files in the docs/dev directory
17+
/docs/dev/CODEX_COMMANDS.md
18+
/docs/dev/COMMIT_COMMENT.txt
19+
/docs/dev/NEXT_COMMANDS.txt
20+
/docs/dev/commit_comment.txt
21+

docs/dev/CODEX_COMMANDS.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
MODEL: GPT-5.4
1+
MODEL: GPT-5.4
2+
REASONING: high
3+
4+
COMMAND:
5+
- implement deploy monitoring/ops layer
6+
- add post-deploy verification checks
7+
- standardize logging and operator messaging
8+
- define rollback/abort expectations where practical
9+
- keep deploy work under scripts/PS/deploy/
10+
- commit format:
11+
description first line
12+
PR name last line
13+
- update roadmap status only

docs/dev/COMMIT_COMMENT.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Adds deploy release flow
1+
Adds a meaningful deploy-operations layer with post-deploy verification, monitoring/logging expectations, clearer operator messaging, and rollback/abort guidance so the Docker deployment flow is easier to validate and run.
22

3-
BUILD_PR_LEVEL_09_30_DEPLOY_RELEASE_FLOW
3+
BUILD_PR_LEVEL_09_31_DEPLOY_MONITORING_AND_OPERATIONS

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD_PR_LEVEL_09_31_DEPLOY_MONITORING
1+
BUILD_PR_LEVEL_09_32_DEPLOY_DOCUMENTATION_AND_HANDOFF
Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,32 @@
1-
Adds release flow
1+
BUILD_PR_LEVEL_09_31_DEPLOY_MONITORING_AND_OPERATIONS
2+
3+
Scope:
4+
- Implemented a deploy monitoring/ops layer under `scripts/PS/deploy/`.
5+
- Added post-deploy verification checks and standardized operator-facing messaging.
6+
- Defined practical rollback/abort behavior in update flow.
7+
8+
Implemented:
9+
- `WebsiteRepoDeploymentCommon.ps1`
10+
- Added ops artifacts to deployment paths:
11+
- `meta/website-deploy-last-verify.json`
12+
- `meta/website-deploy-ops-log.jsonl`
13+
- `meta/website-deploy-ops-state.json`
14+
- Added reusable ops helpers:
15+
- `Write-DeployOpsEvent`
16+
- `Write-DeployOpsState`
17+
- `Get-WebsiteDeploymentVerificationResult`
18+
- `Prep-WebsiteRepoDeployment.ps1`
19+
- Added start/success ops state/event writes around staging preparation.
20+
- `Update-WebsiteRepoDeployment.ps1`
21+
- Added post-deploy verification stage after apply.
22+
- Emits verification report JSON.
23+
- Aborts on verification failure with explicit operator guidance.
24+
- Supports practical rollback behavior with `-RollbackOnVerificationFailure`.
25+
- Enforces rollback safety by requiring `-ConfirmDestructive` when rollback is requested.
26+
- `Clean-WebsiteRepoDeployment.ps1`
27+
- Includes new ops/verify artifacts in metadata cleanup path.
28+
- Adds cleanup stage ops state/event writes.
29+
30+
Outcome:
31+
- Deploy scripts now expose a consistent operational trail (state + event log + verify report),
32+
with standardized success/failure messaging and practical rollback/abort expectations.
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
[ ] release flow works
1+
[x] PowerShell parse/readiness checks pass on touched deploy scripts
2+
[x] Update apply path emits post-deploy verification report and verification passes in smoke run
3+
[x] Ops monitoring artifacts are generated (`ops-log`, `ops-state`, `last-verify`) during deploy flow
4+
[x] Operator messaging standardized for stage start/success/failure/next-step outputs
5+
[x] Rollback guard enforced: `-RollbackOnVerificationFailure` requires `-ConfirmDestructive`
6+
[x] Metadata cleanup removes ops/verify artifacts when `DEPLOY_REMOVE_METADATA=true`
7+
[x] Script structure validation smoke run passes
8+
[x] Roadmap updated with status-only change

docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@
627627
- [x] finish active promotion-gate lane enough to remove it from half-active status
628628
- [.] convert repo structure normalization into exact move-map BUILDs with explicit validation
629629
- [.] re-baseline this roadmap after active execution lanes stabilize
630-
- [.] split future implementation into small dependency-ordered PRs
630+
- [x] split future implementation into small dependency-ordered PRs
631631
- [ ] avoid broad repo-wide cleanup passes until the active lanes above are materially further along
632632

633633
- [x] relocate active template surfaces to `tools/templates/` and remove the empty root `templates/` directory
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# BUILD_PR — LEVEL 09_31 — DEPLOY MONITORING AND OPERATIONS
2+
3+
## Objective
4+
Add a meaningful deploy-operations layer with post-deploy verification, monitoring/logging expectations, clearer operator messaging, and rollback/abort guidance for the Docker deployment flow.
5+
6+
## Scope
7+
- post-deploy verification
8+
- monitoring/logging expectations
9+
- operator-facing success/failure messaging
10+
- rollback/abort guidance
11+
- keep work under scripts/PS/deploy/
12+
13+
## Out of Scope
14+
- no engine changes
15+
- no gameplay/runtime changes
16+
- no tool UI changes
17+
18+
## Roadmap Instruction
19+
- update roadmap status only where applicable

scripts/PS/deploy/Clean-WebsiteRepoDeployment.ps1

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (Test-Path -LiteralPath $paths.siteRoot) {
2727
$targets.Add($paths.siteRoot)
2828
}
2929
if ($config.removeMetadata) {
30-
foreach ($metadataPath in @($paths.planPath, $paths.updateReportPath, $paths.dockerfilePath, $paths.composePath, $paths.dockerIgnorePath)) {
30+
foreach ($metadataPath in @($paths.planPath, $paths.updateReportPath, $paths.verifyReportPath, $paths.opsLogPath, $paths.opsStatePath, $paths.dockerfilePath, $paths.composePath, $paths.dockerIgnorePath)) {
3131
if (Test-Path -LiteralPath $metadataPath) {
3232
$targets.Add($metadataPath)
3333
}
@@ -58,6 +58,14 @@ if ($executionMode.isDryRun) {
5858
}
5959

6060
Assert-ExplicitDestructiveConfirmation -IsDryRun:$executionMode.isDryRun -ConfirmDestructive:$ConfirmDestructive.IsPresent -OperationName "Clean-WebsiteRepoDeployment delete" -TargetCount $targets.Count
61+
Write-DeployOpsState -Paths $paths -Operation "clean" -Stage "cleanup-artifacts" -Status "running" -Message "Cleaning deployment artifacts." -Data @{
62+
targetCount = $targets.Count
63+
removeMetadata = $config.removeMetadata
64+
}
65+
Write-DeployOpsEvent -Paths $paths -Operation "clean" -Stage "cleanup-artifacts" -Status "start" -Message "Starting deployment artifact cleanup." -Data @{
66+
targetCount = $targets.Count
67+
removeMetadata = $config.removeMetadata
68+
}
6169

6270
foreach ($target in $targets) {
6371
if (-not (Test-PathWithinRoot -Path $target -RootPath $paths.stagingRoot)) {
@@ -69,6 +77,17 @@ foreach ($target in $targets) {
6977
Remove-Item -LiteralPath $target -Recurse -Force
7078
}
7179

80+
if (-not $config.removeMetadata) {
81+
Write-DeployOpsState -Paths $paths -Operation "clean" -Stage "cleanup-artifacts" -Status "success" -Message "Deployment artifacts cleaned." -Data @{
82+
targetCount = $targets.Count
83+
removeMetadata = $config.removeMetadata
84+
}
85+
Write-DeployOpsEvent -Paths $paths -Operation "clean" -Stage "cleanup-artifacts" -Status "success" -Message "Deployment artifacts cleaned." -Data @{
86+
targetCount = $targets.Count
87+
removeMetadata = $config.removeMetadata
88+
}
89+
}
90+
7291
Write-DeployLog -Level "SUCCESS" -Message "Cleaned website deployment artifacts." -Data @{
7392
script = "Clean-WebsiteRepoDeployment"
7493
mode = $executionMode.label

scripts/PS/deploy/Prep-WebsiteRepoDeployment.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,22 @@ if (-not $PSCmdlet.ShouldProcess($paths.stagingRoot, "Prepare website deployment
6868
Ensure-Directory -Path $paths.stagingRoot
6969
Ensure-Directory -Path $paths.siteRoot
7070
Ensure-Directory -Path $paths.metaRoot
71+
Write-DeployOpsState -Paths $paths -Operation "prep" -Stage "prepare-staging" -Status "running" -Message "Preparing deployment staging directories and artifacts."
72+
Write-DeployOpsEvent -Paths $paths -Operation "prep" -Stage "prepare-staging" -Status "start" -Message "Starting deployment staging preparation." -Data @{
73+
includePathCount = $normalizedIncludePaths.Count
74+
webPort = $config.webPort
75+
}
7176
Write-JsonFile -Value $plan -Path $paths.planPath
7277
Write-DockerDeploymentArtifacts -Paths $paths -WebPort $config.webPort
7378
Assert-DockerArtifactReadiness -Paths $paths
79+
Write-DeployOpsState -Paths $paths -Operation "prep" -Stage "prepare-staging" -Status "success" -Message "Deployment staging preparation completed." -Data @{
80+
planPath = $paths.planPath
81+
dockerfilePath = $paths.dockerfilePath
82+
}
83+
Write-DeployOpsEvent -Paths $paths -Operation "prep" -Stage "prepare-staging" -Status "success" -Message "Deployment staging preparation completed." -Data @{
84+
planPath = $paths.planPath
85+
dockerfilePath = $paths.dockerfilePath
86+
}
7487

7588
Write-DeployLog -Level "SUCCESS" -Message "Prepared website deployment staging." -Data @{
7689
script = "Prep-WebsiteRepoDeployment"

0 commit comments

Comments
 (0)