Buildkite integrates with Bitbucket to provide automated builds based on your source control. Your code pushes to BitBucket can automatically trigger Buildkite builds, and pull requests can have their build status live-updated as builds progress.

Screenshot of the Bitbucket builds popup

This guide shows you how to setup your BitBucket builds with Buildkite.

Set up the Bitbucket webhook

Once you’ve created a pipeline in Buildkite and pasted in your’s repository URL, Buildkite will show you setup instructions for configuring your BitBucket webhooks.

You can also find these instructions by following the "Bitbucket Setup Instructions" link on your Buildkite pipeline’s Settings page:

Screenshot of BitBucket setup instructions link

The setup instructions give you a direct link to your Bitbucket repository’s Webhooks settings, instructions, and a custom webhook URL for the pipeline:

Screenshot of BitBucket setup instructions on Buildkite

Once you’ve followed the link you can add a new webhook:

Screenshot of a BitBucket webhook settings

After filling out the webhook details using the instructions from your Buildkite pipeline settings, click save, and you’re ready to push a build.

Enabling commit status updates

If you want your Bitbucket pull request’s build status icons to be updated as builds progress, you’ll need to connect your Bitbucket account with Buildkite. You only need to do this once, and if you don't need build status updates you can skip this step altogether.

To connect your Bitbucket account open Buildkite’s Personal Settings, choose Connected Apps then click the Connect button:

Screenshot of the Buildkite Connected Apps screen

You'll be prompted to give permission for Buildkite to post status updates, and then redirected back to your Connected Apps page.

Branch configuration, status updates and tags

You can edit the Bitbucket settings for each pipeline from the pipeline’s settings page:

Screenshot of the Buildkite Bitbucket settings

Mercurial support

Buildkite Agent’s default source control tool is Git, and doesn’t support Mercurial out of the box. If you want to use Buildkite with a BitBucket Mercurial repository, you’ll need to add your own Mercurial checkout code using a custom Buildkite Agent global checkout hook.