6

I think I've done the hard part already: the Github webhook after a push always returns a success message.

I can build manually. But it never builds after the push, because "polling" never happens.

Both the GitHub Hook Log and Git Polling Log say "Polling has not yet run".

Here is my configuration:

  • Branches to build: refs/heads/checkJenkins
  • Build Triggers: GitHub hook trigger for GITScm polling, Poll SCM
  • Build: Execute shell: 'git pull'

Any ideas on how to get the polling started?

A side question: which should be doing the polling when I'm using the webhook in github: the "GITScm polling" or "Poll SCM"? Can I delete one of those settings?

Triggers and build

Bret Hess
  • 407
  • 4
  • 10

2 Answers2

4

Poll SCM is to scan the repository for changes at regular intervals as specified by the cron under Schedule. So this option is redundant.

Now coming to the hook, is it configured to deliver everything or just the push event? You can hit http://<jenkins_url>/log/all in your browser to see the system log while pushing changes. Towards the bottom of this log, see if Jenkins has received the hook and poked the job. If the hook is not received, reconfigure it at GitHub to send the appropriate events. Else, delete and recreate the job as sometimes Jenkins fails to register a new job to poke on receiving events and at other times a new job itself doesn’t respond to poking.

Dibakar Aditya
  • 3,893
  • 1
  • 14
  • 25
  • True Poll SCM can run a schedule, but if you put in no schedule it says "No schedules so will only run due to SCM changes if triggered by a post-commit hook". So apparently it does run on hooks. I'm still confused because both settings I chose run on hooks. – Bret Hess Dec 11 '19 at 20:59
  • The `http:///log/all` does show setup actions, but nothing from GitHub. But the GitHub webhook page shows many successful payloads sent. – Bret Hess Dec 11 '19 at 21:02
  • Please have a look here https://support.cloudbees.com/hc/en-us/articles/224621648-GitHub-Webhook-Troubleshooting?mobile_site=true. – Dibakar Aditya Dec 12 '19 at 00:23
  • Thanks for that article Dibakar. When I go to Manage Jenkins, I see only Manage Plugins related to plugins. I don't see any way to alter the properties of GitHub Plugin, only uninstall it. – Bret Hess Dec 12 '19 at 23:07
0

It's enough to keep only GitHub hook trigger for GITScm polling on, because this is the right option for conditional triggers (following git push as opposed to scheduled as a cron job, i.e. proper polling 1).

As for ideas on how to get the triggering (not polling) started, consult my "pre-flight checklist" here, because it's not a trivial matter.


Side note: feel free to report it to the Jenkins Github Plugin devs if you also think that the word "polling" is misplaced in this option (as per the definition of this term).

mirekphd
  • 4,799
  • 3
  • 38
  • 59