Git integration with Bitbucket

When setting up a new app on Opbeat you will be asked to setup Git integration. Some Git services like GitHub and Bitbucket are natively supported in Opbeat, while others can be connected using SSH keys.

See the Git integration article for a list of supported services.

How to connect a Bitbucket repository

1. Add a deploy key to your Bitbucket repository

First, choose the Bitbucket tab to integrate Opbeat with your Bitbucket repository.

To annotate stacktraces and help you correlate errors to releases, Opbeat needs to have read-access to your repository. For this we use deploy keys.

Add the deploy key to your Bitbucket repository like so:

  1. Log into a repository on Bitbucket with an account that has administrative rights to that repository.
  2. Go to the repository’s settings.
  3. Choose “Deployment keys” in the left hand menu.
  4. Choose “Add Key”. The system displays the Add SSH Key dialog.
  5. Enter a label and the deploy key. Choose “Add key”.
  6. Bitbucket notifies you via email that a key was added to your account.

2. Paste the SSH url to your repository

Final step is to input the SSH URL for your repository. It is formatted like this:

git@bitbucket.org:{user/group name}/{repository name}.git

Note: It is important that you use the SSH URL and not HTTPS, as the latter does not use the deploy key for authentication.

Now click the ‘Connect’ button and you have integrated your Opbeat app with your Bitbucket repository.

How to change repository

If you want to change the url of your Bitbucket repository, go to the settings for your app and click the “Change repository” button. If you are changing from a non-Bitbucket repository, make sure you choose the Bitbucket tab to start setting up the Bitbucket integration.