通过HTTP连接到Github上固定詹金斯post-commit钩子 [英] Connect Github to secured Jenkins via HTTP Post-Commit Hook

查看:208
本文介绍了通过HTTP连接到Github上固定詹金斯post-commit钩子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了詹金斯与我的测试服务器上GitHub的插件。我已经通过只允许通过验证的用户(匿名用户不具有任何权利),并安全连接紧固詹金斯。

I have set up Jenkins with the Github plugin on my test server. I have secured Jenkins by only allowing authenticated users (anonymous users don't have any rights) and secure connections.

不幸的是,提交后通过Github上提供的似乎并不在我的情况下工作挂钩。我试着在 HTTPS访问网址://jenkins.on.my.server/github-webhook/ 手动,它给了我一个net.sf.json.JSONException:空对象的错误,因为我没有用我的请求一起张贴任何JSON这是很好的。

Unfortunately the post-commit hook offered by Github doesn't seem to work in my case. I've tried to access the URL at https://jenkins.on.my.server/github-webhook/ manually and it gave me a "net.sf.json.JSONException: null object" error, which is fine since I didn't post any JSON along with my request.

我的问题:

我已获得詹金斯与验证的用户,因此我在格式使用URL https://user@pw:jenkins.on.my.server/github-webhook/,对?因为我不希望所有过网后的凭据,我可以使用安全连接为Github的post-commit钩子?

I have secured Jenkins with authenticated users, thus I have to use a URL in the format https://user@pw:jenkins.on.my.server/github-webhook/, right? As I don't want to post the credentials all over the net, can I use a secure connection as post-commit hook for Github?

推荐答案

有这个拨弄相当一段时间之后,我结束了使用优秀的 Github上的OAuth插件的詹金斯。引用文档:

After having fiddled around with this for quite some time, I ended up using the excellent Github OAuth Plugin for Jenkins. To quote the documentation:

由于0.4版本有授权使用GitHub的 - 网络挂接回调URL的接收后从GitHub承诺挂钩的​​一种方式。

Since version 0.4 there is a way to authorize the use of the github-webhook callback url to receive post commit hooks from Github.

随着 Github的插件触发构建,这个作品最优雅的!

Along with the Github Plugin which triggers the build, this works most elegantly!

这篇关于通过HTTP连接到Github上固定詹金斯post-commit钩子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆