4

Jenkins 2.32.1, all plugins updated to latest versions today. I had this problem with somewhat older versions of plugins so I don't think it's just a recent plugin bug.

My project builds fine when I ask it to in the Jenkins UI. It also builds fine when I configure it to poll. However, I can't get it to build triggered by pushing to Github.

In my project's configuration,

  • "Github project" is checked and the URL (https://github.com/myorg/myrepo/) is entered below that
  • "Build when a change is pushed to GitHub" is checked
  • and then there is

enter image description here

On the Github side, I have

enter image description here

Webhook deliveries are successful, i.e. return HTTP status 200.

On https://jenkins.myorg.com/job/api/GitHubPollLog/ I see

Last GitHub Push
Started on Jan 11, 2017 10:33:41 PM
Using strategy: Default
[poll] Last Built Revision: Revision ee4b3fe5b57ecd5ae5875bce573b32bb60074dfa (refs/remotes/origin/master)
using GIT_SSH to set credentials 
 > git ls-remote -h git@github.com:myorg/myrepo.git # timeout=10
Found 2 remote heads on git@github.com:myorg/myrepo.git
Using strategy: Default
[poll] Last Built Revision: Revision ee4b3fe5b57ecd5ae5875bce573b32bb60074dfa (refs/remotes/origin/master)
using GIT_SSH to set credentials 
 > git ls-remote -h git@github.com:myorg/myrepo.git # timeout=10
Found 2 remote heads on git@github.com:myorg/myrepo.git
Done. Took 2 sec
No changes

The "last built revision" lines do indeed say the SHA of the revision that was most recently built (manually). But there are changes, because I just pushed a bogus update for testing purposes.

In Jenkins' main log I see

Jan 11, 2017 10:33:41 PM INFO
org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber onEvent
Received POST for https://github.com/myorg/myrepo
Jan 11, 2017 10:33:41 PM INFO
org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber$1 run
Poked api

and nothing more.

I know similar questions have been asked many times. I've checked all of the considerations mentioned in

without success and read many others without getting any other insight. Any suggestions?

Community
  • 1
  • 1
Dave Schweisguth
  • 36,475
  • 10
  • 98
  • 121

3 Answers3

0

We eventually bypassed this problem by switching to the Jenkins functionality that scans one's Github organization and automatically creates a job for each repo with a Jenkins file. Repos thus created did build automatically when pushed to.

Dave Schweisguth
  • 36,475
  • 10
  • 98
  • 121
0

Are you using public IP for your Jenkins server?

I run on the same problem, and I am using socketxp for making a tunnel for the hooks to be public but still does not work, so I switch to Poll SCM

enter image description here

zdravko zdravkin
  • 2,090
  • 19
  • 21
-1

We are using Jenkins ver 1.570-CIaaS, This have the below option which make the build trigger for every PR ( PR from any user ).

Build Triggers This have an option GitHub Pull Request Builder .

Not sure whether i answer to your question , just in case if this information helps.

jAvA
  • 557
  • 1
  • 8
  • 22