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

Integrate Jenkins with Bitbucket Cloud without using webhooks

Samuel Medina
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 4, 2023

Good day, community!

So we have our Bitbucket Cloud, and a Jenkins server setup in a private subnet inside an AWS VPC. We're looking to integrate the two without using any webhooks in Bitbucket, as we CANNOT expose the Jenkins server to the public internet. We want to achieve the following:

  • Publish branch build results to PRs so that we can set up a successful build merge check on PRs

So far, we've seen some plugins that can accomplish some of the functionality we want:

But we are concerned that these plugins have no recent releases in the last 3 - 4 years, and Bitbucket Build Status Notifier depends on another deprecated plugin.

We're hoping for advise on how to proceed with the integration between our Bitbucket Cloud and Jenkins without using webhooks.

 

2 answers

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 7, 2023

Hi Samuel and welcome to the community!

A webhook simply sends a request to your server when an event that triggers it occurs, it doesn't create any build status updates in Bitbucket Cloud.

An application can use our API to create build status updates:

If there is an option in Jenkins to run something like an after-script once a build is finished and get the exit code of the build, you could use an API call in that after-script to update a commit's build status depending on the build's exit code.

You don't need to make your instance accessible from anywhere on the internet but it needs to be accessible from Bitbucket's IPs, both for polling and for running the API call. You can find the IPs used by Bitbucket Cloud here:

Please feel free to reach out if you have any questions.

Kind regards,
Theodora

0 votes
Clifford July 5, 2023

Hi Samuel
check out https://plugins.jenkins.io/git/
Set this up on a Poll SCM every min this will do what you need.
This is what I use.

Samuel Medina
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 6, 2023

Hello Clifford,

 

Thank you for your answer. Please note that we already have that set-up in our Jenkins. What we'd like is something that could help us send build status updates to our Bitbucket repositories without the use of Webhooks.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events