Release 3.6
Release Pipeline Hardening
Persistent per-env runtime config, production symlink rename, port scheme rationalisation
Overview
The release script now assembles a build worktree from a clean git checkout, pulls runtime config from a persistent per-environment directory, and atomically swaps the environment symlink on success. Release directory naming and port allocations were rationalised so an operator can tell at a glance which release is live and which service lives on which port.
What Changed
Persistent Runtime Config
~/config/<env>/on each host now holdsapp.env.local,ordering.env.local,app.credentials.json,ordering.credentials.json, and Google API tokens.- Release script copies these into the fresh build worktree before running schema migrations. Clean checkouts do not carry production secrets.
- Rotating a secret means editing one file per host. No more per-release copy scripts.
Symlink Rename: source -> live
- Production lived at
~/sourcewith releases namedsource-YYYYMMDD-HHMMSS. - Renamed to
~/livewith releases namedlive-YYYYMMDD-HHMMSSto match operator mental model. - Preprod, candidate, UAT, and staging use the same pattern (
~/preprod,~/candidate, etc.) with matching release dirs.
Port Scheme
| Range | Environment |
|---|---|
| 3xxxx | production |
| 4xxxx | preprod |
| 5xxxx | candidate |
releases(supervisor) anddossier-api(systemd) processes allocated into their env's range.post-release.shrestarts the correct processes based onLIVE_LINK_NAME/DEPLOY_ENV.
Webpack / Asset Pipeline
- Symfony UX vendor packages now copied into
node_modules/for the Stimulus bridge to locate them during build. assets:installruns in the final release location rather than the build worktree so the symlinks land on the right path.- Re-publish Symfony assets after the build-worktree -> releases-dir move.
Media Symlinks
app/public/uploadsandapp/public/mediare-created as symlinks to/mnt/efs/ftsuser/media-files/...on every release so user-uploaded content survives a deploy.
Bare Repo Fetch Hardening
- Release script updates all branch refs during fetch, not just the tracked one, so feature-branch builds work correctly.
- Reliable git changelog generation + auto-cleanup of old release dirs (keep last 3).
Files Touched
| File | Change |
|---|---|
scripts/release-prod-safe.ts | Build worktree, config copy, symlink swap |
scripts/post-release.sh | Service restart dispatch on env |
scripts/bootstrap-prod.ts | Production bootstrap with full vendor copy |
| Environment config on each host | New ~/config/<env>/ layout |
Changelog Reference
- feat: rename production symlink from source to live (27ccdf0)
- feat: use persistent
~/config/<env>/for runtime files during release (20df588) - feat: add release:candidate command for candidate environment (246134a)
- fix: align post-release service restarts with new port scheme (fd3c38f)
- fix: copy Symfony UX vendor packages into node_modules for Stimulus bridge (03f70a5)
- fix: re-publish Symfony assets after moving build to releases dir (135c1b7)
- fix: restore persistent symlinks (media/uploads) from live release (b38cc0e)
- fix: use copy mode for assets:install - symlinks break on directory move (4b7338a)
- fix: update bare repo branch refs during fetch (7e69050)
- fix: reliable git changelog and auto-cleanup old releases (7f2356b)