Atomic prod deploy: release-dir + symlink swap to end in-place node_modules/.next churn#1703
Draft
pulzzejason wants to merge 1 commit into
Draft
Atomic prod deploy: release-dir + symlink swap to end in-place node_modules/.next churn#1703pulzzejason wants to merge 1 commit into
pulzzejason wants to merge 1 commit into
Conversation
…otstrap On-box, Capistrano-style release construction for the self-hosted PM2 VPS (root@DEPLOY_HOST, /opt/product-manager). Foundational unit for moving off the in-place mutation of /opt/product-manager/app; the deploy.yml wiring task depends on it. Subcommands (idempotent), so CI can SCP prebuilt artifacts BETWEEN steps: - bootstrap: create releases/ + shared/, migrate app/.env.local into shared/.env.local once (copy if absent); re-running is a no-op. - prepare <id> [ref]: build releases/<id> as a detached git worktree at the target SHA (its own prisma/, migrations, src/) reusing app/.git (or a shared clone) as source of truth, symlink shared/.env.local in, and print the release dir path on stdout as the SCP target (git chatter kept off stdout). - migrate <id>: from the release dir, source shared/.env.local and run prisma migrate deploy + the schema-drift check BEFORE any swap. Drift WARN mode by default (DRIFT_GATE_BLOCK=true to fail); a check ERROR never blocks. - prune [keep] [id]: keep the newest N (default 5); never remove the deploy target or the currently-live (current-linked) release; unregisters worktree metadata. Nothing runs from a fresh release dir, so SCPing node_modules/ never hits the "Text file busy" problem — no worker prestop. Deliberately does NOT flip the `current` symlink or touch PM2 (kept in the dedicated wiring task) so this stays independently reviewable. set -euo pipefail, shellcheck-clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integration PR for this goal — its tasks commit onto this branch (one PR per goal). Opened automatically by the engine on first push; left as a draft until the goal completes.