问题
curl -X POST http://xxx.yyy.zzz:5555/job/job-name/build --user john-devops-jenkins:11df3ed41129c5c7da1518e9c3149896de -H 'Jenkins-Crumb:31827a74a160347a641c87ddbc8e3b6e'
The above curl code with a post request is absolutely working fine in triggering the Jenkins build.
Tried:
- http://xxx.yyy.zzz:5555/bitbucket-hook?token=auth_token&crumb=xyz_crumb
- http://xxx.yyy.zzz:5555/job/job-name/build?token=auth_token&crumb=xyz_crumb
Error: No valid crumb was included in the request
No luck still, How to configure bitbucket hook to container header information of crumb or how to pass it via url without relying on third party plugins?
回答1:
After a day of effort and brainstorming of how curl requests execute, finally resolved this issue by configuring bitbucket webhook as below:
http://jenkins-username:jenkins-password@jenkins-url:5555/job/job-name/build?crumb=crumb_token.
Hope it helps, many questions are unanswered and all are suggesting to use third party or generic-web-hooks and so on.
来源:https://stackoverflow.com/questions/56416925/how-to-pass-crumb-info-via-bitbucket-hook-to-jenkins