Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Deny PR on Bitbucket Cloud if build fails on self hosted Bamboo

Roberto De Oliveira December 28, 2018

On my work team we are thinking about the possibility of deny a PR if the build for it fails. I have been searching on Internet but I can't find how to achieve the following goals:
- Fully integrate a bamboo server with repositories on bitbucket cloud with ssh keys. At this moment I can see the comments and commits on bamboo builds, but I can't see the build status on bitbucket cloud for the commits.
- Create rules for PR on failing tests, deny the PR.

I found at Bitbucket repository configuration the "Links" section, indeed there is an option that says "bamboo", but it asks me for a "link url" and "link key", I put my bamboo server URL but it doesn't accept it, also I can't find documentation about those values.

Any advice on this? Thanks in advance.

1 answer

0 votes
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 3, 2019

Hello @Roberto De Oliveira,

- Fully integrate a bamboo server with repositories on bitbucket cloud with ssh keys. At this moment I can see the comments and commits on bamboo builds, but I can't see the build status on bitbucket cloud for the commits.

In general this scenario happens when the Bamboo instance is not reachable from Bitbucket cloud, which means that your Bamboo instance is not accessible through the internet.

These are configuration steps:

  1. make sure your Bamboo is reachable from the internet.
  2. create a repository in Bamboo using the type Bitbucket cloud.
    The configuration will request your user credentials to browse the repositories. Once you select the repository you should be able to set the access though SSH.
  3. add a repository polling trigger or configure the trigger using webhooks (Triggering a Bamboo build from Bitbucket Cloud using Webhooks).
  4. configure the Bamboo branch management to use Pull Requests.
  5. create a pull request and check if the build was triggered.
  6. when the build is finished, check if the status was updated for the pull request on Bitbucket cloud.

- Create rules for PR on failing tests, deny the PR.

There is no automation for this in Bitbucket cloud, but you could try implementing your own using our APIs (Bitbucket API - Pull request)

I hope it helps!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events