Skip to content

plx deploy --environment: every app of the repo, in parallel, one block and one line per app - #69

Merged
davidjalbers merged 9 commits into
plain-pipelinefrom
davidjalbers/plx-224-plx-deploy-environment-every-app-of-the
Dec 2, 2026
Merged

davidjalbers merged 9 commits into
plain-pipelinefrom
davidjalbers/plx-224-plx-deploy-environment-every-app-of-the

Conversation

@davidjalbers

@davidjalbers davidjalbers commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

plx deploy with neither host nor app deploys every app of the checkout that has a record in the environment, in parallel (Decisions § 4.1 to § 4.5).
The form plx deploy <host> <app> --image <ref> is unchanged.

What it does

  • plx deploy --environment <name> --inventory <dir>; without --environment the environment follows from the branch (GITHUB_EVENT_NAME, GITHUB_REF_NAME).
  • Each app's image is <prefix>/<app>:<commit>; the commit is --commit or the checkout's HEAD, the prefix is IMAGE_PREFIX or ghcr.io/<owner of GITHUB_REPOSITORY>.
  • The apps deploy through the existing deploy, each in a Context of its own whose narration is buffered and written as one block, under ── <app> → <target> ──.
  • The last lines are ✓ or ✗ per app, in the order of the names; exit 1 if any failed; a throw in one app stops no other.
  • The branch rule (environmentOf) moved from plx-ci plan to packages/lib/src/deployTargets.ts; plx-ci plan imports it from there and nothing else in cli-ci changed.
  • renderDeploy of the command became describeDeploy in lib, since the repo form prints the same text.

Decisions the issue did not make

  • Repo form is chosen by absence of both positionals; a host without an app is a usage error.
  • --inventory has no default in the repo form; it is required.
  • The repo form refuses --image, --display-version, --commit-sha, --app-dir and --source (named as typed; an empty value counts as absent), and the one-app form refuses --inventory and --commit: each app's image follows from the commit, and the display-version flags stay for the one-app form only.
  • The deploy target of the inventory (ssh://user@host[:port]) goes to ssh as it is, as the one-app form already does.
  • The commit is also handed to each app as PLEXUS_COMMIT_SHA where its compose file uses it (what the pipeline passes today); a --commit that is not a full 40-digit hash is refused once, in the command, as a usage error before any app is deployed.
  • An app with no record is named in one line before the blocks and has no line at the end; an app whose record has no target has no block, only its ✗ line naming the app and the file (the text of untargetedError).
  • Without an environment (no flag, branch gives none) is a usage error.
  • -vv is capped at -v inside an app's block, since subprocess output inherited from the terminal cannot be buffered.
  • The image naming (imageRef, imagePrefix) now exists in lib and, as before, in cli-ci (imageName, imagePrefix); I left the cli-ci copy alone as instructed, the plan's deletion or the publish helper should collapse it.
  • Dry run prints each app's lines in its block; its exit is 1 too when an app has no target.

Size

+660 −38 lines in 10 files at 5e15bb9, of which tests +408 −9 and the rest +252 −29.
The non-test code is about 130 lines of deployEnvironment with its types, 20 lines of header, 16 for imageRef/imagePrefix/describeDeploy, 13 for the moved rule, and the command with its refusals of the other form's flags.
The additions stay because the verb is new behaviour; nothing was copied: the deploy of one app, the inventory reading and the per-app legs are the existing ones.

Verify

At 5e15bb9:

  • TURBO_FORCE=true mise run test: run by the author, exit 0, 7 of 7 tasks.
  • A packed build of plx installed in an empty project: the refusals of --commit, of the one-app flags in the repo form and of --inventory and --commit in the one-app form, as usage errors with exit 2.
  • The full verify, including mise run e2e, is run by the coordinator on this head before the merge.

🤖 Generated with Claude Code

@davidjalbers davidjalbers self-assigned this Dec 2, 2026
davidjalbers and others added 3 commits December 2, 2026 03:56
…ce, and each form refuses the other's flags (PLX-224)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@davidjalbers
davidjalbers merged commit c855f68 into plain-pipeline Dec 2, 2026
2 checks passed
@davidjalbers
davidjalbers deleted the davidjalbers/plx-224-plx-deploy-environment-every-app-of-the branch December 2, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant