Skip to content

Deployment Commands - Inspect Bitbucket Deployments

Inspect the deployments Bitbucket Pipelines records when a step declares a deployment: environment. The commands are read-only; trigger deployments with bb pipeline run.

Deployment commands operate at repository scope. Run them inside a cloned Bitbucket repository, or pass -w, --workspace <workspace> and -r, --repo <repo> explicitly.

All three subcommands accept the global flags, including --json [fields] and --jq <expression>.


Terminal window
bb deployment list [--limit <number>] [--all]
Terminal window
bb deployment list
bb deployment list --all
# → { workspace, repoSlug, count, deployments }
bb deployment list --json --jq '.deployments[].uuid'
UUID ENVIRONMENT STATUS RELEASE COMMIT DATE
-------------------------------------- ----------- ----------- ------- ------------ ------------
{3c6f1a2e-7b4d-4e8a-9f0c-1d2e3f4a5b6c} Production SUCCESSFUL #42 abcdef012345 8 months ago
{8a9b0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d} Staging IN_PROGRESS - - 8 months ago
  • Bitbucket’s deployment payloads reference environments by UUID only, so the table view fetches all environment pages to show names. If that lookup fails, it falls back to UUIDs. --json skips that call and returns the deployments exactly as the API sends them (environment is not enriched by the CLI).
  • STATUS is the completed result (SUCCESSFUL, FAILED, STOPPED) when there is one, otherwise the state (IN_PROGRESS, UNDEPLOYED).
  • DATE is when the deployment completed, else when it started, else the release creation time.
  • Rows come in the order Bitbucket returns them: the deployments endpoint documents no sort order and takes no sort parameter. On a repository with more than 25 deployments, pass --all (or a higher --limit) before concluding what is deployed where.

View one deployment: environment, status, release, commit, deployer, and timing.

Terminal window
bb deployment view <uuid>
Terminal window
bb deployment view "{3c6f1a2e-7b4d-4e8a-9f0c-1d2e3f4a5b6c}"
# → { workspace, repoSlug, deployment }
bb deployment view "{3c6f1a2e-7b4d-4e8a-9f0c-1d2e3f4a5b6c}" --json --jq '.deployment.state.name'

Quote the UUID: most shells treat {...} specially.


List the repository’s deployment environments.

Terminal window
bb deployment environments [--limit <number>] [--all]
Terminal window
bb deployment environments
# → { workspace, repoSlug, count, environments }
bb deployment environments --json --jq '.environments[].name'

Columns: name, environment type (Test, Staging, Production), and UUID.