muster deploy

muster deploy

Deploy every service, or the ones you name, then run each service's health check.

Synopsis

Terminal
muster deploy [flags] [service...]

Description

Without a service name in a terminal, muster asks whether to deploy all services or a selection. In scripts, CI and --json mode it deploys every service. Services run in deploy_order; services with skip_deploy: true are left out.

What happens

muster loads muster.json and .env (or the muster env store), takes the project deploy lock, runs preflight checks, and checks that the hooks are approved on this machine. Then, for each service: skill pre-deploy hooks, an optional git pull, deploy.sh, skill post-deploy hooks and the health check. The lock is released at the end, whatever the result.

When a service fails

muster prints the last log lines, Kubernetes diagnostics when they apply, and the likely cause from the rules engine. In a terminal you then pick Retry, Rollback, Skip and continue, or Abort (plus Fix when a safe fix exists). Without a terminal the deploy records the failure and continues, unless you pass --stop-on-failure.

Timeout

Each hook gets deploy_timeout seconds (default 120, set per service in muster.json). The value is exported to every stack as MUSTER_DEPLOY_TIMEOUT. A hook that runs over is stopped and recorded with exit code 124 and status timeout.

muster.json
{
  "services": {
    "api": { "deploy_timeout": 300 }
  }
}

Cancelling

Ctrl+C (or SIGTERM) stops the running hook and every process it started, releases the project and service locks, and records a cancelled event in history.

Flags

FlagDescription
--dry-runPreview the deploy plan without executing.
--forceOverride the deploy lock if one exists.
--jsonOutput NDJSON, one JSON object per line.
--stop-on-failureStop at the first failed service. The rest are reported as not_run (no recovery menu).
--from <service>Start at this service in deploy order (resume after a fix).
--no-preflightSkip pre-deploy checks (tools, cluster, disk, ports, env).
--yesApprove changed or unapproved hooks without review (for CI; same as MUSTER_APPROVE_HOOKS=1).
--strategy <s>rolling, blue-green or canary for this run. Overrides muster.json; blue-green and canary need a Kubernetes service.
--version <v>Version label for this deploy (default: IMAGE_TAG, git tag, short SHA). Exported to hooks as MUSTER_DEPLOY_VERSION.
--no-waitBlue-green or canary: stop after the first step and exit 0. Continue with muster promote.

Examples

Terminal
muster deploy                          # interactive: all services or a selection
muster deploy api                      # just api
muster deploy api web                  # several services, in that order
muster deploy --dry-run                # preview every service
muster deploy --json                   # stream events as NDJSON
muster deploy --json --stop-on-failure # stop at the first failure
muster deploy --from web               # resume from web onwards
muster deploy api --strategy canary    # canary this deploy
muster deploy api --no-wait --json     # start a rollout from CI, promote later
muster deploy fleet prod               # deploy a project group (= muster group deploy prod)

Exit codes and JSON

CodeMeaning
0Every selected service deployed (or is paused waiting for promote) and passed its health check.
1A service failed, was rolled back, failed its health check, was skipped because of an error, or hooks weren't approved. A hook that runs past deploy_timeout also ends here.
130Cancelled with Ctrl+C or SIGTERM.

--json streams start, log, done, health, hint, diagnosis and rollout events, then one summary. A cancelled run ends with {"event":"cancelled"}. Needs MUSTER_TOKEN with the deploy scope. Full event list: JSON API.