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.
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.
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.
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.
ReplyHi 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
ReplyHi.. How could we get public IP for adding a Webhook?
ReplyHi, can you provide any sample examples....
Replyin step 5 , article is saying create job in jenkins
Replywhat is that specific job? is it mavenproject or freestyle project or etc?
Bullshit article
Reply