Triggering a Jenkins build automatically when a push to Bitbucket introduced

Jenkins is the best CI/CD tool to work with and one of the most fundamental need is to setup the webhook with it. Bitbucket is a git registry and in this story, I will share you the steps how you can setup the webhook with BitBucket and Jenkins so whenever any commit push to your Bitbucket repo, it triggers a build on Jenkins.

  1. Install Jenkins with Default and Bitbucket plugins.

2. Move to your Job configuration(localhost:8080/job/<Job>/configure) then select valid git URL for your Bitbucket repo and select checkbox for Build when a change is pushed to BitBucket

3. Now you have to move to your bitbucket repo and need to set webhook for mentioned Bitbucket repo. Move to your Bitbucket repo and navigate to a Settings page. Over there you will find Webhooks link so click on that. Now, by clicking on Add Webhook button it would display Name, URL and other fields, you need to set Name(Give any) and URL( http://<JENKINS_URL>:<PORT>/bitbucket-hook/)

That’s it! Now when you push any commit to this repository your Jenkins build automatically get triggered.

Like what you read? Give Pratik Patel a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.