Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get webhook working with Bitbucket Server and Jenkins

a_learner September 8, 2019

Simple setup on a couple of VMs for testing/learning.

vm1. Jenkins 2.176.3-1.1 on CentOs 7.6. 
vm2. Bitbucket Server on Centos 7.6

I have created a repo in Bitbucket server and I have created a build (simple test) and Jenkins does connect to Bitbucket and pull down the repo.  So the Jenkins to Bitbucket build piece appears to be working.

I want to configure a webhook so that the build triggers on a push to the repo.

So I have installed:

Bitbucket Plugin Installed in Jenkins https://wiki.jenkins.io/display/JENKINS/BitBucket+Plugin

Post Webhooks For Bitbucket plugin installed in BitBucket Server https://marketplace.atlassian.com/apps/1215474/post-webhooks-for-bitbucket?hosting=server&tab=overview

Follow along to the instructions here

https://confluence.atlassian.com/bitbucketserver065/managing-webhooks-in-bitbucket-server-976162856.html

and here https://wiki.jenkins.io/display/JENKINS/BitBucket+Plugin

In my bitbucket server repo

Repository settings > Webhooks > Create Webhook

Name: webhook
URL: http://vm1:8080/job/train-schedule/bitbucket-hook/

Click Test and get

403 - "No valid crumb was included in the request"

I suspect something is wromg with the URL value. Anyone know how to fix?

1 answer

0 votes
Roli Balicas June 29, 2020

I have encountered this. I fixed it by doing something like this:

http://vm1:8080/bitbucket-hook/

Or if it still doesn't work

http://vm1/bitbucket-hook/

 

My Jenkins was behind a load balancer so I'm not sure which of the two will work.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events