Documentation Index
Fetch the complete documentation index at: https://docs.compartment.dev/llms.txt
Use this file to discover all available pages before exploring further.
compartment promote takes a deployment that exists in one environment and makes it the active deployment in another. No new build runs — the exact same built artifact is promoted, so traffic switches immediately once the promoted deployment passes its readiness checks. Use this command after reviewing a candidate in a staging environment, or as part of an automated promotion pipeline.
Usage
--from and --to are required. If your project has multiple services, use --service to target a specific one; otherwise all services in the project are promoted together.
Options
| Flag | Type | Default | Description |
|---|---|---|---|
--from <name> | string | — | Required. Name of the source environment to promote from. |
--to <name> | string | — | Required. Name of the target environment to promote to. |
--project <name> | string | — | Project slug to target. If omitted, Compartment reads the project name from compartment.yml in the current directory. |
--service <name> | string | — | Limit promotion to a single named service. If omitted, all services in the project are promoted. |
--verbose | boolean | — | Print deployment progress events to the terminal as they occur. Only applies when --output is text. |
--output <format> | text | json | text | Output format. Use json for machine-readable results in CI pipelines. |
Examples
Promote staging to production after a review
Promote a specific service only
Promote with live progress output and JSON result
If you run
compartment promote without --project, the command looks for a compartment.yml file in the current directory to determine the project name. Run the command from your repository root, or pass --project explicitly when running outside the project directory.