Bitbucket Deployments

Track the deployments you execute through Bitbucket Pipelines and give your team insight into the status of your deployment environments and visibility over what code changes land in each environment.

Bitbucket Deployments supports deploying to the following three environments:

  • test
  • staging
  • production

Get started with Bitbucket Deployments

If you haven't configured Pipelines to perform deployments, refer to our deployment guides for your preferred platform.

Step 1: Enable Bitbucket Deployments

Click Deployments in the repository sidebar to start the set up process. If you have not enabled Pipelines, you will be prompted to configure a bitbucket-pipelines.yml file after selecting a language template.

Step 2: Configure your deployment steps

Modify your bitbucket-pipeline.yml file to add deployment: test to the step that performs the deployment to your test environment. Bitbucket Deployments supports deploying to the teststaging and production environment.

Commit the update to your bitbucket-pipeline.yml file and run your deployment pipeline.

Example bitbucket-pipelines.yml file
image: node:7.5.0

    - step:
        name: Build and push to S3
          - apt-get update
          - apt-get install -y python-dev
          - curl -O
          - python
          - pip install awscli
          - aws deploy push --application-name $APPLICATION_NAME --s3-location s3://$S3_BUCKET/test_app_$BITBUCKET_BUILD_NUMBER --ignore-hidden-files
    - step:
        name: Deploy to test
        image: aneitayang/aws-cli:1.0
        deployment: test
          - python test
    - step:
        name: Deploy to staging
        image: aneitayang/aws-cli:1.0
        deployment: staging
        trigger: manual
          - python staging
    - step:
        name: Deploy to production
        image: aneitayang/aws-cli:1.0
        deployment: production
        trigger: manual
          - python prod

Step 3: Track your deployments

Once your deployment step has run, you can track your deployments on the Deployments page.

Deployments dashboard

It's now easier to find the information you want about each environment including:

  • Which environments have deployments in progress
  • What's currently in each environment
  • A deployment history for each environment

The Deployments dashboard shows a summary of which version of software is running in each tracked environment, along with a complete history of earlier deployments.

Only deployments and environments with deployment tracking enabled in your bitbucket-pipelines.yml will be visible on the Deployments page.

Environment Summary

The environment summary on the Deployments dashboard shows the status of each tracked environment.

  1. Environment name
  2. Promotion button displaying the number of commits to be deployed to the next environment
  3. Date of this deployment
  4. Person who initiated the deployment (if it was a manual deployment)
  5. Build number
  6. Commit hash and message
  7. Status of deployment

Deployment Review and Promotion

We display the promotion button when the current artifact in an environment can be manually deployed to the next environment.

The number on the promotion button represents the number of commits that will be released as part of the deployment. Clicking on the promotion button launches the deployment review screen which allows you to review the changes that will be deployed.

Note: you can only have one in-progress deployment in each environment.

Deployment History

The deployment history shows a complete history of tracked deployments in the repository. You can filter the history list to see the deployments to a specific environment. 

Deployment Summary

The deployment summary is triggered by clicking on a deployment in the environment summary or in the history list. The summary shows information about the deployment including:

  • The environment it was deployed to
  • The previous deployment in the environment
  • The status of the deployment
  • The triggerer of the deployment (if the deployment was a manual step)
  • The date the deployment occurred
  • A ful list of commits in the deployments
  • A file diff between the new deployment and the previous deployment in the environment

Last modified on Feb 20, 2018

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.