Skip to content

Let local-dev.sh deploy from a sibling git worktree #6030

Description

@Yicong-Huang

Feature Summary

bin/local-dev.sh always builds and runs the stack from its own checkout, so deploying a PR branch means either switching the main checkout's branch (disrupting in-flight work) or copying the tooling into each worktree. There is no way to keep one stable copy of the orchestration script while pointing the build/run at a different worktree.

Proposed Solution or Design

Separate the orchestration tree (where local-dev.sh, tui.py, and the docker overlay live — always used from the canonical checkout) from the application source tree that gets built and run.

  • up / auto accept --worktree=PATH or --branch=NAME (resolved to the worktree that has it checked out) to deploy a sibling worktree; a plain up returns to the current checkout.
  • The selection persists to $STATE_DIR/deploy-source, so status / down / logs / single-service rebuild / auto all follow the active deployment, and status --json reports worktree / source.
  • Build stamps are namespaced per source tree so switching worktrees never skips a required rebuild.
  • The interactive TUI mirrors the CLI: u / a accept the selectors and re-point the banner to the active tree.

Invalid --branch / --worktree fail fast with a clear message.

Affected Area

Deployment / Infrastructure

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions