Skip to content

Instantly share code, notes, and snippets.

@Sysa
Created December 12, 2018 10:48
Show Gist options
  • Save Sysa/8a85a6d13a2e3f58bc7a0298d00d9a8b to your computer and use it in GitHub Desktop.
Save Sysa/8a85a6d13a2e3f58bc7a0298d00d9a8b to your computer and use it in GitHub Desktop.
Multibranch projects relationships
to get the scrumb:
http://Jenkins_User:Jenkins_User_Secret_like_6f9dd2bf8e2a5e737d296@YourJenkinsHost:8080/crumbIssuer/api/xml?xpath=/*/crumb/text()
trigger Jenkins multibranch project from bitbucket:
Bitbucket side
go to the bitbucket repository -> repository settings -> webhooks -> create webhooks:
name - as you wish, only for display
URL - this is general pain, see more below.
Secret - ?!?! - sometime Jenkins's secret, sometime empty. More here - http://docs.atlassian.com/bitbucketserver/docs-0514/Managing+webhooks+in+Bitbucket+server?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash#ManagingwebhooksinBitbucketServer-webhooksecrets
URL should be valid, like this:
https://JenkinsserverURL/git/notifyCommit?url=https://bitbucket.repository-link/repository.git
***to specify the branch in repository webhook:
http://yourserver/git/notifyCommit?url=<URL of the Git repository>[&branches=branch1[,branch2]*][&sha1=<commit ID>]
Jenkins side
Enable `Manage Hooks` under Manage Jenkins > Configure System > Bitbucket Endpoints to allow Jenkins to automatically register webhooks to that endpoint
Check that you are using empty schedule for the project
use the same (ssh or http) link to your repo as you use in job\pipeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment