Skip to content

bb deployment

Record, read and delete the deployments of a commit

3 commands.

bb deployment create
Create or update a repository-scoped deployment for a commit
bb deployment delete
Delete repository-scoped deployment for a commit
bb deployment get
Get repository-scoped deployment details for a commit

bb deployment create

Create or update a repository-scoped deployment for a commit

bb deployment create <commit> [flags]
# Record that a commit went to production
bb deployment create a1b2c3d --repo PROJ/repo --key deploy-128 \
  --display-name "Deploy 128" --deployment-sequence-number 128 \
  --env-key prod --env-name Production --env-type PRODUCTION \
  --state SUCCESSFUL --url https://ci.example.com/deploys/128
--deployment-sequence-number int
Sequence number of the deployment
--description string
Description of the deployment
--display-name string
Display name of the deployment
--env-key string
Environment key
--env-name string
Environment display name
--env-type string
Environment type (one of: PRODUCTION, STAGING, TESTING, DEVELOPMENT, UNKNOWN)
--env-url string
Environment URL
--key string
Deployment key
--state string
Deployment state (one of: PENDING, IN_PROGRESS, SUCCESSFUL, FAILED, CANCELLED, ROLLED_BACK, UNKNOWN)
--url string
Deployment URL

Inherited from bb deployment:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  key?                       string                                                               Deployment key, unique per environment
                                                                                                  and commit.
  displayName?               string                                                               Human-readable deployment name.
  description?               string                                                               Longer description, when one was given.
  state?                     PENDING|IN_PROGRESS|SUCCESSFUL|FAILED|CANCELLED|ROLLED_BACK|UNKNOWN  Where the deployment got to.
  url?                       string                                                               Link to the deployment in the deploying
                                                                                                  system.
  environment?               object                                                               Environment deployed to.
    key?                     string                                                               Environment identifier, unique within
                                                                                                  the repository.
    displayName?             string                                                               Human-readable environment name.
    type?                    string                                                               Environment classification, for example
                                                                                                  PRODUCTION or STAGING.
    url?                     string                                                               Link to the environment, when one is
                                                                                                  configured.
  repository?                object                                                               Repository the deployed commit belongs
                                                                                                  to.
    projectKey               string                                                               Project key the repository belongs to.
    slug                     string                                                               Repository slug.
  toCommit?                  string                                                               Commit that was deployed, the one the
                                                                                                  deployment was created on.
  fromCommit?                string                                                               Commit the previous deployment of this
                                                                                                  key to this environment deployed, so
                                                                                                  what this one brought in is everything
                                                                                                  after it.
  deploymentSequenceNumber?  integer                                                              Ordinal of this deployment within its
                                                                                                  environment, which is how two
                                                                                                  deployments of the same key are told
                                                                                                  apart.
  lastUpdated?               integer                                                              When the record last changed, in
                                                                                                  milliseconds since the epoch.

bb deployment delete

Delete repository-scoped deployment for a commit

bb deployment delete <commit> [flags]
# Remove one deployment of a commit
bb deployment delete a1b2c3d --repo PROJ/repo --key deploy-128 --env-key prod \
  --deployment-sequence-number 128
--deployment-sequence-number string
Identify by deployment sequence number
--env-key string
Identify by environment key
--key string
Identify by deployment key
-y, --yes
Confirm without being asked; applies only when the target is named with --repo PROJECT/slug

Inherited from bb deployment:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  status        string  Outcome of the command.
  repository    object
    projectKey  string  Project key the repository belongs to.
    slug        string  Repository slug.
  commit        string  Commit the deployment was recorded against.
  key?          string  Deployment key that was deleted, when one was given.

bb deployment get

Get repository-scoped deployment details for a commit

bb deployment get <commit> [flags]
# Where a commit was deployed
bb deployment get a1b2c3d --repo PROJ/repo --key deploy-128 --env-key prod \
  --deployment-sequence-number 128
--deployment-sequence-number string
Filter by deployment sequence number
--env-key string
Filter by environment key
--key string
Filter by deployment key

Inherited from bb deployment:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  key?                       string                                                               Deployment key, unique per environment
                                                                                                  and commit.
  displayName?               string                                                               Human-readable deployment name.
  description?               string                                                               Longer description, when one was given.
  state?                     PENDING|IN_PROGRESS|SUCCESSFUL|FAILED|CANCELLED|ROLLED_BACK|UNKNOWN  Where the deployment got to.
  url?                       string                                                               Link to the deployment in the deploying
                                                                                                  system.
  environment?               object                                                               Environment deployed to.
    key?                     string                                                               Environment identifier, unique within
                                                                                                  the repository.
    displayName?             string                                                               Human-readable environment name.
    type?                    string                                                               Environment classification, for example
                                                                                                  PRODUCTION or STAGING.
    url?                     string                                                               Link to the environment, when one is
                                                                                                  configured.
  repository?                object                                                               Repository the deployed commit belongs
                                                                                                  to.
    projectKey               string                                                               Project key the repository belongs to.
    slug                     string                                                               Repository slug.
  toCommit?                  string                                                               Commit that was deployed, the one the
                                                                                                  deployment was created on.
  fromCommit?                string                                                               Commit the previous deployment of this
                                                                                                  key to this environment deployed, so
                                                                                                  what this one brought in is everything
                                                                                                  after it.
  deploymentSequenceNumber?  integer                                                              Ordinal of this deployment within its
                                                                                                  environment, which is how two
                                                                                                  deployments of the same key are told
                                                                                                  apart.
  lastUpdated?               integer                                                              When the record last changed, in
                                                                                                  milliseconds since the epoch.