Using webhook to trigger Jenkins job don't work

2,242 views
Skip to first unread message

Kenneth Holter

unread,
Mar 5, 2015, 5:26:54 AM3/5/15
to rundeck...@googlegroups.com
Hi all,


I'm trying to get our Rundeck server to trigger a Jenkins-job. I'm using http://jenkins.example.com/plugin/rundeck/webhook/ URL as suggested by the documentation, and have set my Jenkins job to trigger build on all Rundeck notifications.

However, nothing happens. I'm suspecting that it might be an authentication issue, since we have glocal security enabled on our Jenkins box. Rundeck logs don't provide any information that the job even triggers the webhook, but I believe it actually does - when I for example use https instead of http I get a redirect (i.e. 302 Found) to http.

I've tried all possible combinations of adding username and password/Jenkins API token to the webhook URL, but still no success.

Any advice on how to get this working is greatly appreciated.

Best regards,
Kenneth Holter

Kenneth Holter

unread,
Mar 13, 2015, 9:11:20 AM3/13/15
to rundeck...@googlegroups.com

I added this to httpd.conf:

<Directory /plugin/rundeck/webhook/>
  Satisfy Any
  Allow from all
</Directory>

The Apache log on the Jenkins server (btw, the same linux server as Rundeck runs on) shows that Rundeck get a 200 respons:
10.33.43.79 - - [13/Mar/2015:14:07:07 +0100] "POST /plugin/rundeck/webhook/ HTTP/1.1" 200 6 "-" "Jakarta Commons-HttpClient/3.0.1"

But still, there's no sign of the Jenskins server actually running the job.

dzz...@gmail.com

unread,
Apr 21, 2015, 9:39:28 AM4/21/15
to rundeck...@googlegroups.com
Hello,
I had a similar problem and it ended up to be the URI. I have jenkins on AJP port and Apache http config set to ProxyPass. And we access jenkins like so: http://host.example.com/jenkins

ProxyPass /jenkins ajp://localhost:8009/jenkins
ProxyPassReverse /jenkins ajp://localhost:8009/jenkins
ProxyPreserveHost On

and tried http://host.example.com/jenkins/plugin/rundeck/webhook/ and it worked.
Try:
http://jenkins.example.com/jenkins/plugin/rundeck/webhook/

Also, last I tried the UUID ( In Jenkins Rundeck section) did not work and I had to put in the project:job explicitly and that worked. Could be that one as well.
Hope that helps.
Cheers, Dharmendra

Alex Maccabi

unread,
Apr 30, 2015, 2:47:06 AM4/30/15
to rundeck...@googlegroups.com
Hey, I had a different issue of 403 because Jenkins has security enabled (GitHub Auth) .
Enabling Read permission to anonymous. 

George Quintas

unread,
Apr 12, 2019, 8:04:18 AM4/12/19
to rundeck-discuss

Rundeck webhook did not work with my setup. Somehow, Rundeck webhook is not working whatever changes I've done with Jenkins.

As an alternative, I used Jenkin's build trigger : Generic Webhook Trigger plugin. It works when my Rundeck jobs completed Succesfully.


https://wiki.jenkins.io/display/JENKINS/Generic+Webhook+Trigger+Plugin


Example below:

http://jenkins-url/generic-webhook-trigger/invoke?token=your-token

rac...@rundeck.com

unread,
Apr 24, 2019, 3:39:08 PM4/24/19
to rundeck-discuss
Hi guys, 

You have another option, for that you'll install the Http Notification Plugin (https://github.com/rundeck-plugins/http-notification), copy the .jar file on $RDECK_BASE\libext (usually at /var/lib/rundeck/libext)

Based on that fix: https://jenkins.io/changelog/#v2.96 you have two options:

1) When creating or editing your job you can go to HTTP Notifications section and put "http://jenkinshost:8080/job/MyJob/build?token=YourJobToken" on Remote URL textbox, select POST on HTTP Method option and a bit bottom press "Authentication" button, select Authentication "basic", Username/Client ID with your Jenkins user and in Password/Client Secret put the user API Token.

2) And the second option: In HTTP Notification section put "http://jenkinsuser:YourUserToken@jenkinshost:8080/job/HelloWorld/build?token=mytoken" directly and select POST on HTTP Method option.

To generate the User API Token in Jenkins click on "People" (left menu), click your user and select "Configure" (left menu again) and go to "API Token" > Add new Token (you'll copy to use it Rundeck configuration above).

Hope it helps!
Reply all
Reply to author
Forward
0 new messages