First to Site
Release 3.6

Post-Deploy Verification & LLM Summary

Automated health checks, git changelog, and email report after every release

Overview

Releases now run a verification pass immediately after the symlink swap and service restart. The pass gathers health checks, commit history, runtime metadata, and an optional LLM-generated narrative, and emails the combined report. If anything fails the release can be rolled back via the previous symlink target.

What Changed

Verification Script

  • scripts/post-deploy-verify.ts runs against the newly-deployed release.
  • Health checks hit platform, releases, and dossier-api endpoints with a PASS/FAIL status per env.
  • PHPUnit runs when dev dependencies are present (skipped in production builds by design).
  • Gathers current commit SHA, changelog entries since the previous release, PHP and Node versions, and timestamp.

LLM Summary (Ollama Cloud)

  • When OLLAMA_API_KEY is configured, the verification script asks Ollama Cloud to narrate the changelog into a short deploy summary suitable for a status email.
  • The LLM call is best-effort - if the API is unreachable or rate-limited, the verification continues without the narrative.

Email Report

  • Verification emails go via the server's local MailHog / SMTP relay on localhost:1025.
  • Report body includes the full structured output plus the LLM narrative when available.
  • Raw JSON report is attached so downstream tooling can parse it.

SMTP Hardening

  • Long report lines were hitting SMTP's 998-character limit on some relays. Report generator now chunks long fields.
  • DEPLOY_MAILER_DSN defaults to localhost:1025 so reports land in server MailHog by default.

Files Touched

FileChange
scripts/post-deploy-verify.tsNew verification script
scripts/bootstrap-utils.tsShared utilities (env resolution, command running)
scripts/release-prod-safe.tsInvokes verify step after release
scripts/post-release.shRestarts services before verify runs

How to Use

# After a release, verify runs automatically. Manual invocation:
sudo LIVE_LINK_NAME=live bun /home/ftsuser/releases/<release>/scripts/post-deploy-verify.ts

# Skip LLM summary if unavailable:
unset OLLAMA_API_KEY
sudo LIVE_LINK_NAME=live bun .../post-deploy-verify.ts

Changelog Reference

  • feat: add post-deploy-verify skeleton with environment resolution (42bb51b)
  • feat: add data gathering - tests, git log, health checks, metadata (6f34a1c)
  • feat: add Ollama Cloud LLM summary generation (2f6f1a8)
  • feat: add SMTP email with HTML body and raw report attachment (c35661f)
  • feat: add verify step to release-prod-safe output (7abf620)
  • fix: handle missing PHPUnit in production and SMTP line length (27f1ad9)
  • fix: default DEPLOY_MAILER_DSN to localhost:1025 (cc1ca73)