Bitbucket Server

Buildkite integrates with Bitbucket Server to provide automated builds based on your source control. You can run a build every time you push code to Bitbucket Server, using a webhook that you create in your Bitbucket Server.

Bitbucket Enterprise Server is available to customers on the Buildkite Pro and Enterprise plans.

This guide shows you how to set up your Bitbucket Server builds with Buildkite. It was written using Bitbucket Server version 7.11.1

Step 1: connect Bitbucket Server and set up a pipeline

  1. Select Settings to open the Organization Settings page.
  2. Navigate to Repository Providers.
  3. Select Bitbucket Server.
  4. In URLs, enter the address of your Bitbucket Server, including a port if needed. For example, localhost:8000. You can also restrict which network addresses are allowed to trigger builds using webhooks in Allowed IP Addresses in Network Settings.
  5. Select Save Settings.
  6. Set up a pipeline as normal. Refer to Pipelines for more information.

Step 2: confirm your setup

If your configuration worked, Buildkite automatically recognizes your repository URL as a Bitbucket Server repository. To check this, go to Pipelines > your specific pipeline > Settings. You should see Bitbucket Server on the side as a configurable area for your pipeline.

Step 3: work through the in-app guide to set up your webhook

Buildkite includes built-in instructions on how to set up a Bitbucket Server webhook. This webhook allows Bitbucket Server to trigger Buildkite builds in response to events like code pushes and pull requests.

  1. Navigate to Pipelines > your specific pipeline > Settings > Bitbucket Server.
  2. Select Bitbucket Server Setup Instructions.
  3. Follow the on screen instructions to configure your webhook.

Branch configuration and settings

You can edit the version control provider settings for each pipeline from the pipeline's settings page. Go to Pipelines > your specific pipeline > Settings > your Git service provider.

If you need more control over your pipeline configuration, add a pipeline.yml to your repository. Then you can use conditionals and branch filtering to configure your pipeline.

Using one repository in multiple pipelines and organizations

If you want to use the same repository in multiple pipelines (including pipelines in different Buildkite organizations), you need to configure a separate webhook for each pipeline. Follow the webhook setup instructions in the Buildkite UI. Buildkite shows you these instructions when you create the pipeline, but you can also find them in Pipeline > your specific pipeline > Settings > your Git service provider > your Git service provider's Setup Instructions.

Build skipping

You may not always want to rebuild on every commit, or branch. You can configure Buildkite to ignore individual commits or branches, or to skip builds under certain conditions.