简体   繁体   English

localhost的IP地址:8080-github + jenkins的webhooks

[英]IP address of localhost:8080 -in webhooks of github +jenkins

I am trying to configure webhooks in github so that it will deploy every time I do a new push, I have added web hooks in github and given the address of jenkins which is http://localhost:8080/github-webhook/ but it did not work and I found out that we need to find our IP address and I added it as follows: 我正在尝试在github中配置webhooks以便每次我进行新的推送时都会部署,我在github中添加了web钩子并给出了jenkins的地址,即http://localhost:8080/github-webhook/但是它没有用,我发现我们需要找到我们的IP地址,并按如下方式添加:

http://'ipaddress'/github-webhook/

but I still did not get the jenkins to work? 但我仍然没有让詹金斯工作? Thanks 谢谢

You need a public address for Github to point to when detected a push request. 您需要Github的公共地址指向检测到推送请求时。 localhost is on your localmachine. localhost在您的本地机器上。

The way i solved it is to use a proxy agent Ngrok. 我解决它的方法是使用委托代理Ngrok。 Enter command >ngrok http 8080, it will generate http://{hexa-numbers}.ngrok.io copy the generated public address and put in your github repository webhook http://{hexa-numbers}.ngrok.io/github-webhook. 输入命令> ngrok http 8080,它将生成http:// {hexa-numbers} .ngrok.io复制生成的公共地址并放入你的github存储库webhook http:// {hexa-numbers} .ngrok.io / github -webhook。

At this point when you save it, it will send a post request to ngrok server, got redirected to localhost and you will see a green tick. 此时,当您保存它时,它将向ngrok服务器发送一个发布请求,被重定向到localhost,您将看到一个绿色勾号。

If you are talking about github.com, then yes, localhost would not work. 如果你在谈论github.com,那么是的,localhost将不起作用。
As mentioned in " GitHub webhook configuration " 如“ GitHub webhook配置 ”中所述

the Jenkins instance must be able to connect to GitHub and vice versa. Jenkins实例必须能够连接到GitHub,反之亦然。

You can check that with the "Test hook" button from the GitHub UI and see if Jenkins receive a payload. 您可以使用GitHub UI中的“Test hook”按钮检查它,看看Jenkins是否收到了有效负载。

Make sure you have the JENKINS GitHub Plugin properly installed and configured. 确保正确安装和配置了JENKINS GitHub插件

您仍需要在网址中提供端口:

http://ipaddress:8080/github-webhook/

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

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