Skip to content

alis deploy

Deploy a built service version to one or more product deployment environments.

Synopsis

alis deploy [<package-id>] [flags]

Description

By default the command waits for the operation to finish, streaming progress to stderr and printing the result to stdout. The service is addressed by package ID, which may be omitted inside the service's directory.

Pass --environment for each target deployment environment. If omitted and the product has exactly one deployment environment, that deployment environment is used; otherwise the command errors with ENVIRONMENT_SELECTION_REQUIRED and lists the ids. If --version is omitted, the latest build version for the service is deployed. --plan-only runs only Terraform plan instead of apply; it changes nothing and is not gated by confirmation.

Deploys to a production deployment environment require confirmation: interactively through a [y/N] prompt, otherwise by re-running with --confirm-production after explicit user approval (exit code 3 until then). Deployment environments with designated branches (alis environment branches) additionally require confirmation when the version was built from a different branch (--allow-branch-mismatch, or an interactive [y/N]).

A deployment a product admin has frozen (alis service freeze) refuses every deploy, plan included, with DEPLOYMENT_FROZEN and exit code 1; no flag overrides it. A product admin lifts it with alis service unfreeze <package-id> -e <env-id>.

Flags

Flag Type Default Meaning
--allow-branch-mismatch bool false Proceed even when the version's branch is not designated for a target deployment environment.
--async bool false Start the operation and print its name without waiting.
--confirm-production bool false Required to deploy to a production deployment environment; pass only after explicit user approval.
-e, --environment <id> strings the product's only deployment environment Deployment environment id to deploy to (repeatable).
--plan-only bool false Run only Terraform plan instead of apply.
--poll-interval <duration> duration 2s How often to poll the operation.
--timeout <duration> duration 0 Give up waiting after this duration (0 = wait indefinitely; the operation keeps running).
--version <version> string latest build version Service version to deploy.

Plus the global flags.

Examples

Shell
alis deploy acme.shop.orders.v1 --json -e <env-id>
alis deploy acme.shop.orders.v1 --json -e <prod-env-id> --plan-only
alis deploy acme.shop.orders.v1 --version 1.4.2 --json -e <prod-env-id> --confirm-production
alis deploy --json --async

JSON output

The final operation on stdout, following the output contract. deployments[] holds one entry per deployment environment with name, state, logsUri and progress; a failure appears under deployments[].progress.failure.

Exit codes

Code Envelope Meaning
1 ENVIRONMENT_SELECTION_REQUIRED More than one deployment environment and no -e; details lists them.
3 PRODUCTION_CONFIRMATION_REQUIRED A production deployment environment without --confirm-production. --approve never lifts it.
3 APPROVAL_REQUIRED The manual automation tier gates deploys.