Environments & Branches

A Foundry environment is a named deployment target mapped to a single Git branch. A push to that branch is what triggers a deploy to the environment. Environments are declared under ci.environments, and multi-repo services can override the mapping per-service.

ci.environments

The platform-wide map lives at ci.environments: keys are environment names, values are an environmentConfig. The CLI defaults, if you don't declare them, are:

prod  → release
dev   → develop
test  → qa

environmentConfig

FieldTypeDefaultDescription
branchstringGit branch that triggers this environment (required)
enabledbooleantrueDisabled environments are excluded from pipeline triggers and tfvars generation
autoApprovebooleanfalseWhether IaC changes apply without manual approval
iacobjectProvider-specific config for this env (region, account, domain, …). Supports {name_prefix}, {prefix}, {env} template vars

Example

"ci": {
  "iac": "opentofu",
  "provider": "aws",
  "environments": {
    "prod": { "branch": "release", "autoApprove": false },
    "dev":  { "branch": "develop", "autoApprove": true }
  }
}

Per-service overrides (multi-repo)

Services in different repos may follow different branch conventions. A service-level environments block overrides ci.environments for that service; any environment it omits falls back to the platform-wide value. For example, a service whose repo deploys prod from main:

"web": {
  "repository": "FoundryMedia/foundry-app",
  "environments": { "prod": { "branch": "main" } },
  "deploy": { "strategy": "static" }
}

Where autoApprove is false, the orchestrated pipeline gates the apply through a GitHub Environment's required reviewers rather than the orchestrator script itself. See Orchestrator & Strategies.