Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use webhooks to trigger different Jenkins build jobs for different repo branches?

suchpower
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

I recently moved some repositories from a deprecated Bitbucket Server installation to Bitbucket cloud.

In my repository I'd like to trigger different Jenkins build jobs for different repo branches.

For example, a push to the `develop` branch should trigger a Jenkins job to build the project on my staging site while a push to the `master` branch should trigger a separate Jenkins job to build the project on my production site. I don't see options for that kind of differentiation in the webhook settings.

On Bitbucket Server I was able to specify branches on the Bitbucket side (via a Bitbutcket/Jenkins integration plugin, I believe) to send requests to different Jenkins jobs based on the specified branch(es). The examples & tutorials I've seen for a Bitbucket Cloud/Jenkins setup only seem to connect up via the Jenkins server URL. Who knows which job it will trigger when the request hits Jenkins?

Can I use webhooks to accomplish this?

Can pipelines accomplish this?

What is the recommended approach for this sort of workflow?

1 answer

2 votes
jennifer.dempsey_Appfire
Atlassian Partner
July 6, 2023

Hi @suchpower

Can you tell me which Bitbucket/Jenkins integrations plugin you're using? I'm the Product Marketing Manager for Appfire's Webhook to Jenkins for Bitbucket Cloud.

Best,

Jennifer

suchpower
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

Let's see...in the Jenkins plugin manager I see "Bitbucket Plugin" and "Bitbucket Push and Pull Request Plugin" installed. I inherited this Jenkins installation so I'm guessing I may not need both of those.

The Webhook to Jenkins for Bitbucket Cloud looks like exactly what I need! Where in Bitbucket Cloud do I add/manage integrations?

jennifer.dempsey_Appfire
Atlassian Partner
July 6, 2023

Hi @suchpower 

Great! I'm happy we have a solution for you. I'm going to reach out to a member of our Support team to help you with your question regarding adding/managing your integrations. They'll be happy to walk you through the set up process. Someone will reach out to you soon.

Best,

Jennifer

Naveen Kumar_Appfire
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 7, 2023

Hi @suchpower

Hope you are doing well,

 We have created a support request SUPPORT-96982  However, we couldn't add you as a reporter.


Please sign up using this link sign up and share with us the user name or id.
We will then add you as the reporter and confirm.

As per my understanding, you would like to integrate jenkins with Bitbucket. For this after installing the WJB Cloud app. In the repository setting tab, you have the CONFIGURING WEBHOOKS TO JENKINS option to add/integrate the Jenkins instance as below.

2023-07-07_18-14-34.png

Thanks,
Naveen

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events