How to get Jenkins 2.0 multi branch pipeline and bitbucket 4.8.1 web hook working?

1,933 views
Skip to first unread message

Jeroen Reijn

unread,
Jul 22, 2016, 7:52:45 AM7/22/16
to Jenkins Users
Hi all,

I'm trying to get my multibranch workflow job to trigger based on a change in bitbucket server (previously known as stash).

I've read most of the docs on the several plugins, but I can't seem to get the combination to work. 

What I've done now is configure my project with:

Branch sources -> Bitbucket
Build Configuration -> Mode -> From Jenkinsfile
Bitbucket Server URL -> My custom URL
And I've setup the credentials.

That part seems to work fine, so if I manually trigger the build it runs fine and does the branch indexing.

On the bitbucket side, I've tried to use the following plugins:

1. Bitbucket Server Webhook to Jenkins
I tried this with specificing the jenkins url, but it reports back with:

Error: Jenkins response: No git jobs using repository: http://host:7990/scm/hv/project.git and branches: master No Git consumers using SCM API plugin for: http://host:7990/scm/hv/project.git

I guess this comes from the fact it's a pipeline job that uses a branches sources instead of git in a 'normal' maven base project with git as source.


2. Post-Receive WebHooks

If I use this plugin with the URL http://jenkinshost:8080/bitbucket-hook/ it complaints with:
WARNING: Error while serving http://jenkinshost:8080/bitbucket-hook/ 

net.sf.json.JSONException: JSONObject["user"] not found.

So it seems the request body to the bitbucket hook is not what the server expects. I've found some github issues, but I can't seem to figure out how I can make this work.

I assume I'm not the only one trying this?

Any ideas?

Regards,

Jeroen


Otávio Augusto Soares

unread,
Jul 28, 2016, 5:32:32 PM7/28/16
to Jenkins Users
Have you tried using the "Trigger builds remotely (e.g., from scripts)", setting a token and then add a webhooh to http://JENKINS_URL/job/JOB_NAME/build?token=TOKEN

Unfortunately it's not working for me because I've secured my jenkins and get 403. But you can try.

Jeroen Reijn

unread,
Jul 29, 2016, 3:33:25 AM7/29/16
to Jenkins Users
Hi Otavio,

Yes it tried that, but it did not seem to work or i misconfured something. I think I found a solution with pending PR in the bitbucket source plugin.

Jeroen

Op do 28 jul. 2016 om 23:32 schreef Otávio Augusto Soares <otav...@gmail.com>
--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/GjvZ6Dj8pRc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/94550ff0-a8fe-493e-b442-4fd91213dfa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Dilger

unread,
Aug 18, 2016, 2:03:37 PM8/18/16
to Jenkins Users
So I´m looking into this too.


Martin

Jeroen Reijn

unread,
Aug 19, 2016, 2:55:56 PM8/19/16
to jenkins...@googlegroups.com
Hi Martin,

Yes that specific PR solves my problem. I hope it will me merged and released soon, so we can start using that in our project. If not we will probably cut our own internal release for now and wait for the release.

Jeroen
--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/GjvZ6Dj8pRc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2ff63def-d518-4e40-b1ce-62bf2c8ca566%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Verzonden via Gmail Mobile

Flavio Troia

unread,
Dec 14, 2016, 12:29:37 PM12/14/16
to Jenkins Users
Reply all
Reply to author
Forward
0 new messages