- I would like to trigger Jenkins from Bitbucket Server/Cloud repositories
- CloudBees Jenkins Enterprise - Managed Master (CJE-MM)
- CloudBees Jenkins Platform - Client Master (CJP-CM)
- CloudBees Jenkins Team (CJT)
- DEV@cloud (D@C)
- Jenkins LTS
- Bitbucket Cloud
- Bitbucket Server
On every Git repository there is a hidden
.git folder and inside the .git folder there is a hooks subfolder. This folder can hold scripts that are executed by Git when it performs certain operations. This feature is well documented (see Customizing Git - Git Hooks in the Git documentation).
Bitbucket Cloud and Bitbucket Server provide support to create hooks for your repositories. But implementations are different:
- In Bitbucket Cloud this support is provided by the platform: see Bitbucket Cloud hooks
- In Bitbucket Server this support is provided by add-ons: see Bitbucket Server hooks
This difference in implementations is one of the reasons why solutions differs in Jenkins whether you use Bitbucket Cloud or Server. Plugins are often designed to integrate with one solution only.
Note: We strongly encourage to use Pipeline and Pipeline Multibranch.
In order to better guide you through this, have a look at the article that correspond to your environment:
For configuration of Non-Multibranch jobs
- Bitbucket Cloud: How to Trigger Non-Multibranch Jobs from BitBucket Cloud
- Bitbucket Server: How to Trigger Non-Multibranch Jobs from BitBucket Server
For configuration of Multibranch / Organization jobs
- Bitbucket Cloud: How to Trigger Multibranch Jobs from BitBucket Cloud
- Bitbucket Server: How to Trigger Multibranch Jobs from BitBucket Server
To troubleshoot issues with any of these solutions.Please have a look at: