With this servicehook, you can integrate Bitbucket with Jenkins, an extendable open source continuous integration server
Setting up the service
. If you are having trouble with the hook, see Troubleshoot Bitbucket hooks.
Setting Up the hook
You must have administrative access on a repository to add this hook.
- Go to the Bitbucket 'Admin' tabrepository's settings.
- Click 'Services' Hooks in the 'Additional options/settings' section on the rightleft-hand side of the screennavigation.
The hooks page appears.
- Select the 'Jenkins' service hook from the dropdown list in the 'Services Administration' section Hook dropdown.
- Click 'Add service'hook.
A new section appears for the Jenkins service hook.
Enter the following information:\
- Endpoint – Enter your Jenkins endpoint URL.
- Project name – Enter your Jenkins project name.
- Token -- Enter the Jenkins token (optional).
- Module name -- Enter the Jenkins module name (optional).
- Click 'Save settings'.
The Jenkins hook doesn't presently support csrf protection on the Jenkins server. Please comment or watch this issue for updates on this feature request.
Field Explanation Example Required Module name If set, only commits to the specified module (or directory) will trigger a Jenkins build. apps/Bitbucket Token If your Jenkins server has security enabled, you will need to allow remote access to your job. Access is granted via a token. Visit https://wiki.jenkins-ci.org/display/JENKINS/Quick+and+Simple+Security for further details on setting up remote access in Jenkins. Project Name The name of the Jenkins job you wish to run builds on bitbucket Selenium Tests Endpoint The endpoint URL for your Jenkins instance https://www.bitbucket.org/jenkins/
- Press Save.