Bitbucket Cloud integration with Jenkins?
Asked by Iv?n Mu?oz Mart?nez:

As happens to many of us, we continue to work on a Server or Data Center, but in the coming months we will migrate to the Cloud.

Does anyone have Bitbucket Cloud with Jenkins?

I don't see any information about it, and this question is very important before Cloud migration.

Thanks in advance,


Answers:
author: Patrik S
body: Hello [@Iv?n Mu?oz Mart?nez](/t5/user/viewprofilepage/user-id/4994337) ,

Welcome to Atlassian Community!

It's definitely possible to integrate Bitbucket Cloud with your Jenkins instance, and this is done through a plugin developed by Jenkins, which you can check in the following URL :

* <https://plugins.jenkins.io/bitbucket/>

Essentially, this plugin relies on bitbucket webhooks to receive the events that happen in your repository, such as a new push, to then trigger an event in your Jenkins instance.

You are also welcome to take a look at the following article with step-by-step instructions on how to set up this integration :

* <https://medium.com/ampersand-academy/integrate-bitbucket-jenkins-c6e51103d0fe>

Let me know in case you have any questions.

Thank you, [@Iv?n Mu?oz Mart?nez](/t5/user/viewprofilepage/user-id/4994337) .

Kind regards,

Patrik S

comments: author: Iv?n Mu?oz Mart?nez
body: Hello [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) ,

Thanks for the information!


author: Michael Dinsmore
body: Is it possible to do without webhooks if we don't want to expose our server to the internet?

I'd be happy with a polling solution on my end if it doesn't mean I need to make the server available to external traffic.


author: Patrik S
body: Hello [@Michael Dinsmore](/t5/user/viewprofilepage/user-id/1088148) ,

It's also possible to configure your Jenkins to use the pooling mechanism that would fetch the repository at a given frequency.

The downside of it is that depending on how many repositories you have and how frequently you do the pooling, you might hit the [Bitbucket Cloud API requests limits](https://support.atlassian.com/bitbucket-cloud/docs/api-request-limits/). I would also suggest taking a look at the article [API rate limiting and Jenkins SCM polling](https://community.atlassian.com/t5/Bitbucket-articles/API-rate-limiting-and-Jenkins-SCM-polling/ba-p/1377224) which explains how Jenkins SCM works and how it can hit the API limits.

Than you, [@Michael Dinsmore](/t5/user/viewprofilepage/user-id/1088148) !

Patrik S


author: Michael Dinsmore
body: [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) - I was curious if the new Connect feature is something that could allow me to securely connect? I'm referring to - <https://developer.atlassian.com/cloud/jira/platform/getting-started-with-connect/>

Is there any BitBucket/Jenkins specific instructions available?

thanks,

Mike


author: Patrik S
body: Hello [@Michael Dinsmore](/t5/user/viewprofilepage/user-id/1088148) ,

The Connect framework is designed to build apps that can connect with the Atlassian Applications UI and your own application set. It's usually used to connect Cloud to Cloud applications/services. Unfortunately, I'm not aware of any existing Jenkins plugin that uses the Connect framework.

Thank you, Mike.


author: Nicholas Ayala
body: [@Michael Dinsmore](/t5/user/viewprofilepage/user-id/1088148) I ran into the same issue of how to integrate our internal tools without exposing them to the internet. So depending on how your networking team has their security set up, I have found that Atlassian suggests whitelisting all of their IPs and domain.

Here is the answer I got back from Atlassian:

Since the Atlassian Cloud applications are all web-based, to ensure our apps, third-party apps that run on our products, and any services required for the correct functioning of our ecosystem need to be al;lowed into your network firewalls, proxy, any other network-protection mechanisms you may have in place. You can look at our document [IP addresses and domains for Atlassian cloud products](https://urldefense.com/v3/__https:/support.atlassian.com/organization-administration/docs/ip-addresses-and-domains-for-atlassian-cloud-products/__;!!OrxsNty6D4my!-557mpcWbQhH1wYcEO9RogFveFQWTpErP3rT67rPcBJiBd1MZxTEnKHk3X_7W8pK65oKgPSjepXeffcTC9EWEEqhtU1liUROHHweWA$) where you can see all the IPs and domains that need to be allowed in your network. This is usually done by the infrastructure team/network admins in your organization.

And here is the link for Bitbucket specific whitelisting IPs

[Bitbucket IP Whitelist](https://support.atlassian.com/organization-administration/docs/ip-addresses-and-domains-for-atlassian-cloud-products/#Bitbucket-and-Trello)


author: Michael Dinsmore
body: Thanks [@Nicholas Ayala](/t5/user/viewprofilepage/user-id/5332622) -- I had seen that but was thinking (hoping?) there was an easier way. I would need to set up a process to dynamically get that list and then have it generate a CloudFormation script that defines a Security Group for AWS to then apply to a set of resources within our VPC in AWS.

That seems like a lot of work (development, testing, maintenance) that I'd rather avoid... but maybe there's no other options.


author: jennifer.dempsey_Appfire
body: Thank you for your continued interest in [Webhook to Jenkins for Bitbucket Cloud!](https://marketplace.atlassian.com/apps/1211284/webhook-to-jenkins-for-bitbucket?tab=overview&hosting=cloud) I'm pleased to announce that the Cloud version of this app is now available in the Atlassian Marketplace and is free until the end of the year!

[Try it now](https://marketplace.atlassian.com/apps/1211284/webhook-to-jenkins-for-bitbucket?tab=overview&hosting=cloud) and let us know what you think!

If you have further questions or need assistance with installing or configuring the app, please reach out to me at Jennifer.dempsey@appfire.com and I'd be happy to put you in touch with our Product Manager or Support team.

Cheers,  
Jennifer


author: jennifer.dempsey_Appfire
body: Also, as Jamie mentioned previously, we'll be releasing the Cloud version of Webhook to Jenkins for Bitbucket in the next 1-2 months. Our Product Manager would be happy to answer any questions you might have about planning your cloud migration. Please feel free to email me at Jennifer.Dempsey@appfire.com if you'd like us to help you explore your options.


author: Steve Cuthbertson
body: I'm going to add [this link](https://community.atlassian.com/t5/Bitbucket-questions/What-does-end-of-support-for-passwords-mean-for-me/qaq-p/1851002) here, as since bitbucket cloud have ended support for passwords, some of the information in this post is no longer relevant.

If the link is broken, here is the test:

*What this means is that Atlassian passwords will only let you interactively log into Bitbucket (e.g. via the Bitbucket.org website in a browser) as well as other Atlassian products.*

*If you'd like to use the API or Git over HTTPS you can still do so, you just need to create a new app password. It's really easy to do in the UI.*

*What this means is you'll have 2 (or more) passwords:*

*1. Your Atlassian password which signs you into all Atlassian products.*

*2. A Bitbucket-specific app password that lets you interact with the API or with Git.*

*N. You can create however many app passwords you want with differing levels of access (scope).*

**Using an app password**   
An app password is a substitute password for the user account where you configure it, so you simply use it when authenticating with Bitbucket:

username: your normal Bitbucket username (not your email address)

password: the app password.


author: Jamie Esker _Appfire_
body: Hi Iv?n,

Jamie here with Appfire! Our powerful tool, [Webhook to Jenkins for Bitbucket](https://marketplace.atlassian.com/apps/1211284/webhook-to-jenkins-for-bitbucket?hosting=datacenter&tab=overview), is currently only available for Server and DC, but we are in the process of scoping feasibility of a cloud version. We are hoping to add it to our roadmap in the very near future. I wanted to see if you would be open to speaking with our Product Manager so we can address needs you may have while planning your cloud migration. If so, [schedule some time,](https://calendly.com/d/d35-4b6-fsk/webhooks-to-jenkins-cloud-chat) or let us know if there is a certain time that works best for you.

Cheers,

Jamie, Product Marketing Manager

comments: author: Iv?n Mu?oz Mart?nez
body: Hello [@Jamie Esker _Appfire_](/t5/user/viewprofilepage/user-id/4502987) ,

Thanks for the information, but we are not sure yet if we will migrate Bitbucket to the Atlassian Cloud.


author: inemerovsky
body: [@Jamie Esker _Appfire_](/t5/user/viewprofilepage/user-id/4502987) is there estimated delivery date for webhook cloud version?


author: Jamie Esker _Appfire_
body: [@inemerovsky](/t5/user/viewprofilepage/user-id/4987155) We will have a version available before the end of the year. We are looking for Beta program participants if this is something of interest to you. You can email me at Jamie.esker@appfire.com and I can get you connected with the right people. Thank you!


author: inemerovsky
body: Thank you


author: JoannaYurdal
body: Hi,  
I am also working on integrating Bitbucket cloud with local Jenkins and the Bitbucket server Integration could not be used, nor the webhooks expecting public IP for Jenkins. Is there any suggested solution ( or will there be in the near future)?


Tags: atl-gruland

bitbucket-cloud

cloud