Skip to main content
orun has no built-in concept of a named environment — instead, it uses Git branches. Each node tracks exactly one branch, and everything on that node derives its configuration from manifests on that branch. Promoting a change from staging to production is a standard Git merge. Creating an ephemeral environment is opening a new branch.

How branches map to environments

When you run orun 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
The domain resolver uses this classification to decide whether to use 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 named feat-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

The ingress.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.
With this configuration: The 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:
1

Create a node manifest per environment

Write a separate Node manifest for each environment. Point each at the correct branch and host.
2

Bootstrap each node

Run orun bootstrap once per node manifest. After bootstrap, each node tracks its own branch independently.
3

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.
4

Promote to production by merging to main

When staging looks good, merge to main. The production node reconciles automatically.

Setting up multiple environments

Name your nodes to match their environment (for example, web-staging, web-prod). Because node manifests are committed to the repository, the name appears in Git history and makes it easy to trace which host a configuration change targeted.
Each node independently decides what to run based solely on the manifests in its branch. If you delete a Deployment manifest from main without first removing it from staging, the staging node continues running that container. Always review all branches before removing shared resources.

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.