Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

jenkins - Github webhook URL config issue? How to fix it?

I am using GitHub project repository for build trigger from Jenkins.

The intention is when even code push done in GitHub repository project my Jenkins build should trigger automatically.

Steps done:

  • Create Jenkins job for build trigger
  • Config the setup on that particular job
    • Source Code Management management selected Git and updated Repository URL which I got from GitHub project code and have updated https Git URL
    • updated the GitHub credentials
    • Build trigger option
  • I have selected Build when a change is pushed to GitHub
  • then GitHub have update the webhook from setting
  • I have added the webhook URL like http://ABCDEFGH123:8080/github-webhook/
  • and selected Content type is application/json

While updating the webhook URL it shows the error message:

We couldn’t deliver this payload: Couldn't resolve host name

See the screenshot for reference. Please have a look. Please share the solution. Why am I unable to update the webhook URL? How to fix it?

https://i.stack.imgur.com/YcR2g.jpg https://i.stack.imgur.com/fbpSm.jpg

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Couple of reasons for this to happen.

  1. If your running it locally --> it means that your URL is not exposed to the internet.So you can expose it to the Internet using ngrok (becareful as it exposes you (port) to the internet)
  2. Corporate case-->Will most definitely be a proxy or firewall issue.So you can again use ngrok with proxy settings/Bypass your firewall, a bit of googling on how to do it will help.
  3. You have an Enterprise Git Repo and are still unable to hit the webhook Go to Manage Jenkins --> Configure System-->GitHUB under that you would have mentioned your GitHub Server details, Under that, there is an Advance button, Further under is another Advance button click that. Add another URL for webhook or use the existing one which you would have mentioned.

The neat little feature this provides is that it tests your connection with GitHub and provides you with the reason why it failed.

Hope this helps, took me a long time to figure this out :0


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...