Skip to main content

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 deploy reads the compartment.yml descriptor in your working directory, builds the specified services, and deploys them to a Compartment environment. By default it targets all services defined in the file and deploys to the production environment. Use --service to deploy a single service or --env to target a different environment. Pass --verbose to stream build and promotion progress to your terminal as the deployment runs.

Usage

compartment deploy [options]

Options

FlagTypeDefaultDescription
--env <name>stringproductionName of the target environment.
--project <name>stringOverride the project name from compartment.yml.
--service <name>stringDeploy only the named service instead of all services.
--verbosebooleanfalseStream live deployment progress to the terminal. Ignored when --output json is set.
--output <format>text | jsontextOutput format for the final result.
compartment deploy requires a valid compartment.yml in the current directory. Run compartment init first if you have not set one up.

What deploy does

  1. Reads compartment.yml from the working directory.
  2. Sends the descriptor to the Compartment control plane along with the target environment name.
  3. The platform builds a container image for each service.
  4. After a successful build, the candidate container starts and Compartment runs any configured readiness checks.
  5. Once the candidate is healthy, traffic switches over and the previous container drains. The deployment is marked active.
When the command completes, Compartment prints the final deployment status, including each service’s health, promotion stage, and public route URL.

Output

After a successful deploy, the text output looks similar to this:
web  active  healthy  https://my-app.example.com
For structured output in CI, use --output json to receive the full DeploymentStatusResponse payload.

Examples

compartment deploy
Use --verbose when deploying interactively to watch each promotion stage in real time. For unattended CI runs, omit --verbose and parse the JSON result with --output json.