just release-*The four-phase atomic deploy orchestrator.
release-run+release-revert+release-statecover ~all operator needs. Per Golden Rule 13 these are the only deploy verbs.
For the conceptual walk + the failure-mode drill, see /pma/learn/06-release-and-rollback.
| Recipe | What it does |
|---|---|
just release-run TICKET |
Run the four phases (prepare / migrate / ticket-script / verify) atomically |
just release-revert TICKET |
Restore backups from phase 1, revert the merge commit |
just release-state TICKET |
Show the state file for one ticket (BASE_SHA, MERGE_SHA, SERVICES, BACKUPS) |
just release-return-to-main |
After a hotfix branch release, return prod to main + verify clean state |
| Flag | What it does |
|---|---|
--dry-run |
Run every phase in preview mode, no mutations |
--from=PHASE |
Resume from PHASE (prepare/migrate/ticket/verify). Skips earlier phases. Requires state file if PHASE ≠ prepare. |
--skip-prepare |
Skip phase 1 (audited; partial-failure recovery) |
--skip-migrate |
Skip phase 2 (audited) |
--skip-ticket |
Skip phase 3 (audited) |
--skip-verify |
Skip phase 4 (audited; not recommended) |
--force-allow-non-main |
Required for releases from a non-main branch (hotfix releases) |
| Flag | What it does |
|---|---|
--skip-git |
Don't run git revert -m 1 MERGE_SHA (hotfix branches don't have a merge commit to revert) |
--skip-data |
Don't restore backups (exception path; you almost never want this) |
The orchestrator regenerates migrate.sh from the diff every release. You can run the same regeneration manually for inspection:
bun scripts/release/release-check.ts # local health check
bun scripts/release/release-check.ts --diff main # diff vs main
bun scripts/release/release-check.ts --incoming BRANCH # diff vs incoming branch
bun scripts/release/release-check.ts --remote prod # remote drift check
These don't mutate. Use to preview what a release-run would do.
# On your laptop — code change, commit, push, merge PR to main
git push origin feat/1234-tweak
# Then on prod:
ssh prod 'cd /opt/asd-pma && just release-run 1234'
ssh prod 'cd /opt/asd-pma && just release-run 1234 hotfix/X --force-allow-non-main'
# After verifying the hotfix works on prod, return to main:
ssh prod 'cd /opt/asd-pma && just release-return-to-main'
See docs/operations/RELEASE-HOTFIX-LIFECYCLE.md in the asd-pma repo for full details.
ssh prod 'cd /opt/asd-pma && just release-revert 1234'
For a hotfix release that was ff-pulled (no merge commit):
ssh prod 'cd /opt/asd-pma && just release-revert 1234 --skip-git'
# After fixing the root cause of a phase-N failure:
just release-run 1234 --from=migrate # skip phase 1, start at phase 2
just release-run 1234 --from=ticket # skip phases 1-2
just release-run 1234 --from=verify # only re-run phase 4
# State file (BASE_SHA, MERGE_SHA, SERVICES, BACKUPS for a specific ticket)
just release-state 1234
# Audit log (per-phase timestamps + events)
cat .asd/workspace/releases/1234.log
These collapse the orchestrator's guarantees. Never do them:
| Anti-pattern | Why it breaks things |
|---|---|
ssh prod 'git pull' before release-run |
Collapses BASE_SHA == MERGE_SHA → "nothing to release" |
ssh prod 'git checkout BRANCH' before release-run |
Same problem — release-run wants to do the checkout itself |
Invoking scripts/release/prepare.sh directly |
Bypasses the orchestrator's halt-on-failure between phases |
Invoking releases/TICKET-*.sh directly |
Skips backup + verify, no rollback path |
Running release-revert without a state file |
Revert has nothing to restore; usually a fresh ad-hoc cleanup is needed |
If you're tempted to ssh prod 'git ...' before a release recipe, stop. The orchestrator handles its own git state.
/pma/learn/06-release-and-rollback — the four phases walked end to end./pma/cookbook/debug-a-failed-release — decision tree when something goes wrong./pma/reference/cli/backup — backups taken by phase 1 are what makes revert work.