How branches map to environments
When you runorun bootstrap, the node is configured with a gitBranch value in its Node manifest. From that point on, the node only reads manifests from that branch. Nodes on different branches are completely independent: they share no state, no communication channel, and no coordination mechanism.
The
gitBranch field defaults to main when omitted. To track a different branch, set it explicitly in the Node manifest before running orun bootstrap.Production vs. non-production
orun distinguishes two environment classes:- Production — the primary environment, typically the node tracking
main - Non-production — all other environments: staging, feature branches, ephemeral worktrees
ingress.domain.default or the ingress.domain.environment template when building the service URL.
Worktrees as ephemeral environments
Git worktrees let you check out a branch into a separate directory without affecting the main working tree. orun uses worktrees to scope resources for ephemeral environments. When a node tracks a worktree namedfeat-auth, orun scopes that environment’s resources with a dot-separated prefix — for example, feat-auth. — to prevent naming collisions with production or staging resources on the same host.
Service domain templates
Theingress.domain.environment field in a Service manifest uses $ENV as a placeholder. At runtime, orun replaces $ENV with the environment suffix derived from the branch name or worktree name.
| Branch / environment | Resolved domain |
|---|---|
main (production) | hello-world.orcra.dev |
staging | hello-world.staging.orcra.dev |
feat-auth worktree | hello-world.feat-auth.orcra.dev |
ingress.domain.default value is used for production nodes where no environment suffix applies. The ingress.domain.environment template is used for all other nodes.
Branch-per-environment pattern
The recommended pattern is one branch per long-lived environment and short-lived branches for ephemeral feature environments:Create a node manifest per environment
Write a separate Node manifest for each environment. Point each at the correct branch and host.
Bootstrap each node
Run
orun bootstrap once per node manifest. After bootstrap, each node tracks its own branch independently.Deploy to staging by pushing to the staging branch
Merge or cherry-pick changes to
staging. The staging node picks them up within one poll cycle (default 5s) without any manual deploy step.Setting up multiple environments
- Two environments (prod + staging)
- Ephemeral feature environment
How orun reconciles containers
Understand the pull-based reconciliation loop that drives every node.
Manifest repository structure
Reference for Node, Deployment, and Service manifest fields.
