2

I want Jenkins to trigger build automatically when GitHub PR created, but it seems GitHub unable to communicate with Jenkins, getting an error in GitHub webhook as "We couldn’t deliver this payload: Service Timeout" which is automatically created after below configurations.

my Jenkins server is behind a firewall and I have installed & configured "Github pull request builder". github pull request builder configuration

I have created a job with GitHub project and with below configurations. jenkins project configuration and job trigger configuration

Jenkins proxy test

Any other configuration needed or am I doing something wrong ???

Viren
  • 21
  • 4

2 Answers2

0

Is your jenkins server accessible from the internet? if not, you will need to open your firewall to allow access from github IPs specifically.

You can find githubs IP addresses on the meta endpoint for the api subdomain:

https://api.github.com/meta

Michael J
  • 1,383
  • 2
  • 14
  • 25
  • Hi Michael, I have stored ssh public key of Jenkins into Github "deploy key" section. if still need to make changes please suggest where do I suppose make changes ? – Viren Jul 03 '18 at 03:36
  • You'll need to make the changes where ever your firewall is set up. If you're running in AWS, for example, you'll need to edit the security group of your EC2 instance to allow inbound access on the port that Jenkins is listening to, most likely 8080 unless you have changed it. If you are using some other hosting, then you'll need to modify the firewall accordingly. – Michael J Jul 04 '18 at 04:40
  • Hi Michael, I have done all proxy configuration and my Jenkins is accessible through internet, but still i am getting GitHub error (We couldn’t deliver this payload: Service Timeout) as attached. I have attached Jenkins proxy test in above question, please find and suggest... – Viren Jul 05 '18 at 05:48
  • I think your proxy configuration is for the Jenkins server to go _out_ onto the internet. You need to configure your firewall to allow traffic to come _in_. For example, try opening your Jenkins URL from your phone or some device that is not on your work network. Please reply with the results. – Michael J Jul 06 '18 at 06:28
  • Yes, you are right, github is unable to send post request to Jenkins, will try to find port of communication will that can be open publicly. Thank You @Michael !!! – Viren Jul 11 '18 at 10:04
0

In "Advanced" tab of GHPR select the below option:

  1. Build every pull request automatically without asking (Dangerous!).
  2. Put the name of the branch in Whitelist Target Branches.
סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68
Sanoj
  • 959
  • 11
  • 11