简体   繁体   English

将Jenkins暴露给外界以接收GitHub Webhook请求

[英]Exposing Jenkins to the outside world to receive GitHub webhook requests

I have a Jenkins build server, and my repositories are hosted under an organization on Github.com. 我有一个Jenkins构建服务器,我的存储库托管在Github.com上的组织下。 I would like to trigger automated builds after a push to the repository on GitHub.com. 在推送到GitHub.com上的存储库后,我想触发自动化构建。 To enable this, I need to provide my Jenkins server details as a webhook in the settings of Github.com. 为此,我需要在Github.com设置中以Webhook的形式提供Jenkins服务器的详细信息。 Is it a good practice to open port 8080 from the server in the trust environment so as to be accessible from GitHub.com? 在信任环境中从服务器打开端口8080以便从GitHub.com进行访问是否是一种好习惯?

Yes, in order to receive incoming web hooks, you need to make an HTTP endpoint accessible to GitHub. 是的,为了接收传入的Web挂钩,您需要使GitHub可以访问HTTP端点。 This should only be the webhook URL instead of the complete Jenkins (filtering eg through a reverse proxy in front of the installation). 这只能是webhook URL,而不是完整的Jenkins(例如,通过安装前的反向代理进行过滤)。

"Accessible to GitHub" still gives you the freedom to restrict the IP addresses that may access this endpoint. “可访问GitHub”仍然使您可以自由限制可以访问此端点的IP地址。 The IP addresses used by GitHub are listed here . 此处列出了GitHub使用的IP地址。 As of now, they are in the following two networks: 截至目前,它们位于以下两个网络中:

  • 192.30.252.0/22 192.30.252.0/22
  • 185.199.108.0/22 185.199.108.0/22

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM