MOTOSHARE 🚗🏍️

Rent Bikes & Cars Directly from Owners

Motoshare connects vehicle owners with people who need bikes and cars on rent. Owners earn from idle vehicles, and renters get flexible ride options.

Visit Motoshare

How to build when a change is pushed to Bitbucket

bitbucket-tutorials
Source Code Management
bitbucket-tutorials

 

Bitbucket plugin is designed to offer integration between Bitbucket and Jenkins.

 

It exposes a single URI endpoint that you can add as a WebHook within each Bitbucket project you wish to integrate with. This single endpoint receives a full data payload from Bitbucket upon push (see their documentation), triggering compatible jobs to build based on changed repository/branch.

 

Step 1 – Install “Bitbucket Plugin” at your Jenkins

 

Step 2 – Add a normal Post as Hook to your Bitbucket repository (Settings -> Hooks) and use following url:

 

https://YOUR.JENKINS.SERVER:PORT/bitbucket-hook/
and if you have setup authentication on jenkins then URL must be like

 

https://USERNAME:PASSWORD@YOUR.JENKINS.SERVER:PORT/bitbucket-hook/

 

Step 3 – Configure your Jenkins project as follows:

 

Step 4 – Under build trigger enable Build when a change is pushed to BitBucket

 

Step 5 – under Source Code Management select GIT; enter your credentials and define Branches to build (like **feature/*)

 

Note 1 – Make sure to include the slash (‘/’) on the end of the URL or the hook won’t work.

 

Note 2 – Please read the BitBucket Plugin info page as well https://wiki.jenkins.io/display/JENKINS/BitBucket+Plugin

 

Reference 1  
Reference 2 – Login issues with Jenkins url
0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Aanya
Aanya
6 months ago

Awesome tutorial! Triggering automated builds when code is pushed to Bitbucket is a core practice in modern CI/CD workflows — it eliminates manual polling and ensures your integration and test processes run immediately after changes are committed. To achieve this with Jenkins, you typically install the Bitbucket Plugin, configure a webhook in your Bitbucket repo pointing to your Jenkins bitbucket-hook endpoint, and enable the Build when a change is pushed trigger in your job configuration. Make sure your webhook targets the correct job URL (including the trailing “/”) and that the repository push event is selected, because without that the build may not trigger even if Bitbucket returns a 200 response. This setup helps teams get fast feedback on code quality and accelerates delivery cycles.

1
0
Would love your thoughts, please comment.x
()
x