Jenkins and Github auto trigger

不羁岁月 提交于 2019-12-21 21:52:41

问题


I'm trying to setup Jenkins and Github such that Jenkins will build my project when something is pushed to Github. However, I can't seem to get the webhooks to work. I set the webhook on github to : http://localhost:8080/github-webhook/. I'm running the jenkins server on my laptop, therefore I am using 'localhost'. There might also be an error with this url, as github does say: 'Invalid host'?

I've tried to find some good guides, but none seem to be updated nor mention how to set it up locally. So any help would really be appreciated!


回答1:


This cannot work. localhost maps to the IP address 127.0.0.1, which is just the same machine. So while you can access your local Jenkins installation via localhost, the GitHub server cannot.

You will either need a static IP address or you need to map a DNS entry to your dynamic IP (for example with http://www.dnsdynamic.org). And you need to open the port 8080 for external access. Only then will GitHub be able to reach your local instance with its webhook.



来源:https://stackoverflow.com/questions/28732873/jenkins-and-github-auto-trigger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!