Jenkins Integration with Bitbucket


   
Jenkins Integration with Bitbucket


In this blog, we will learn, how we can integrate our BitBucket Repository with Jenkins to continuous poll it for any modification and execute automation script in case of any changes.


For this purpose, we need to Create Webhook in Bitbucket which is used to build Jenkins's job after each commit.

1)     Login into your BitBucket Account then navigate into the project which we wanted to integrate with Jenkins.

2)     Click on Settingsร WORKFLOWร Webhooks





3)     Click on Add Webhook and provide the Title and URL of Jenkins followed by bitbucket-hook/ (Please Note to add webhook Jenkins should be placed on public IP address, localhost won’t work in this case) and click on Save.


    4) Log in into Jenkins-->Manage Jenkins and Install BitBucket Plugin. Please make sure to restart Jenkins after the plugin installation.



5) Now go to Jenkins Home Page create New Jenkins Job and in Source Code Management Select GIT, Provide the path of the BitBucket Project.



6) Inside Build Triggers, Select Build when Change is pushed to BitBucket



7) Click on Apply and Save the Jenkins Job.

Now whenever any changes will be made to our BitBucket repository automatically Jenkins will trigger the build.



SHARE THIS

Author:

My Name is Ankur Jain and I am currently working as Automation Test Architect.I am ISTQB Certified Test Manager,Certified UI Path RPA Developer as well as Certified Scrum Master with total 12 years of working experience with lot of big banking clients around the globe.I love to Design Automation Testing Frameworks with Selenium,Appium,Protractor,Cucumber,Rest-Assured, Katalon Studio and currently exploring lot in Dev-OPS as well. I am currently staying in Mumbai, Maharashtra. Please Connect with me through Contact Us page of this website.

Previous Post
Next Post
May 16, 2019 at 11:21 PM

Hi Ankur, i am following same steps but at step no 5, getting error not able to connect to git repository, even though correct credentials are given.

Reply
avatar
May 16, 2019 at 11:50 PM

Hi Rajesh, There could be multiple reason for that please make sure u have git installed and had path setup in your Jenkins machine or this issue could also be due to firewall or proxy issue if you are doing on your office network

Reply
avatar
January 29, 2020 at 2:51 AM

Hi.. How could we get public IP for adding a Webhook?

Reply
avatar
May 30, 2020 at 12:32 PM

Hi, can you provide any sample examples....

Reply
avatar
October 7, 2020 at 12:07 PM

in step 5 , article is saying create job in jenkins

what is that specific job? is it mavenproject or freestyle project or etc?

Reply
avatar
Anonymous
December 7, 2020 at 4:56 AM

Bullshit article

Reply
avatar