Buildkite integrates with Bitbucket to provide automated builds based on your source control. You can run a build every time you push code to Bitbucket, and pull requests can have their build status live-updated as builds progress.
This guide shows you how to set up your Bitbucket builds with Buildkite.
On this page:
Set up the Bitbucket webhook
Once you’ve created a pipeline in Buildkite and pasted in your bitbucket.org’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:
The setup instructions give you a direct link to your Bitbucket repository’s Webhooks settings, instructions, and a custom webhook URL for the pipeline:
Once you’ve followed the link you can add a new webhook:
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:
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:
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.