Bitbucket Integration¶
Run as a Bitbucket Pipeline¶
-
Drop this into your repo's
bitbucket-pipelines.yml: -
Under Repository settings > Pipelines > Repository variables, add these secured variables:
CONFIG__GIT_PROVIDER=bitbucketOPENAI__KEY=<your key>BITBUCKET__AUTH_TYPE=bearer(orbasic)BITBUCKET__BEARER_TOKEN=<your token>(required for bearer auth)BITBUCKET__BASIC_TOKEN=<your token>(required for basic auth)
Generate a token from Repository Settings > Security > Access Tokens. For basic auth, base64-encode your
username:passwordpair.Note
Bitbucket Pipelines don't support triggering from PR comments.
Bitbucket Server and Data Center¶
For on-prem deployments, start by generating an HTTP access token from your service account: navigate to Manage account > HTTP Access tokens > Create Token.
Add the token to your secrets file:
Don't forget to point MergeMate at your instance:
CLI Mode¶
Set the git provider in your config:
Then run:
mergemate-review --pr_url https://git.bitbucket.mycompany.com/projects/PROJECT/repos/REPO/pull-requests/1 review
Webhook Mode¶
Build and push the image:
docker build . -t mergemate/mergemate:bitbucket_server_webhook \
--target bitbucket_server_webhook \
-f docker/Dockerfile
docker push mergemate/mergemate:bitbucket_server_webhook
Then head to Projects/Repositories > Settings > Webhooks > Create Webhook. Fill in the name and URL (ending in /webhook, e.g. https://your-domain.com/webhook), set authentication to None, and tick Pull Request Opened as the trigger event.