-
Improvement
-
Resolution: Duplicate
-
Major
-
Jenkins 2.7.2 and GitHub plugin 1.21.1
Hello,
I have encountered issues with automatic hook registering for a pipeline job.
This is the github project:
https://github.com/alanfranz/foolscrate
I have read:
https://issues.jenkins-ci.org/browse/JENKINS-37217
and
https://issues.jenkins-ci.org/browse/JENKINS-34396
I created a new pipeline job, I did set the github project url, checked "build when change is pushed to github", then choose to use the Jenkinsfile from SCM, and set the github ssh url for my project; Initially I had an issue with the auto-registering of any hook, this was the log
Aug 31, 2016 10:40:38 AM FINE com.cloudbees.jenkins.GitHubWebHook$1 apply Calling registerHooks() for foolscrate-v1dev Aug 31, 2016 10:40:38 AM INFO org.jenkinsci.plugins.github.webhook.WebhookManager$1 run GitHub webhooks activated for job foolscrate-v1dev with [] (events: [REPOSITORY])
There were no hooks defined in my github settings page for the repo.
After looking at the issues above, I discovered that I had to manually trigger one build and I needed to set (AFAICU) an explit 'git url:' in my Jenkinsfile. THEN, after that, I had to disable the "Build when change was pushed to github", save the job, RE-ENABLE the option, re-save the job.
After doing that, this was the log:
Aug 31, 2016 10:59:42 AM INFO org.jenkinsci.plugins.github.webhook.WebhookManager$1 run GitHub webhooks activated for job foolscrate-v1dev with [GitHubRepositoryName[host=github.com,username=alanfranz,repository=foolscrate]] (events: [REPOSITORY]) Aug 31, 2016 10:59:43 AM FINE org.jenkinsci.plugins.github.webhook.WebhookManager$3 applyNullSafe Created hook https://api.github.com/repos/alanfranz/foolscrate/hooks/9722521 (events: [REPOSITORY]) Aug 31, 2016 11:00:06 AM FINE org.jenkinsci.plugins.github.webhook.WebhookManager unregisterFor Check GHRepository@20f660a4[description=<null>,homepage=<null>,name=foolscrate,license=<null>,fork=false,watchers=0,forks=0,size=66,milestones={},language=Shell,commits={},source=<null>,parent=<null>,url=https://api.github.com/repos/alanfranz/foolscrate,id=65638029] for redundant hooks...
And still nothing happened on push.
See the issue? It seems the hook was created only for REPOSITORY events, but not for PUSH events!
I entered my github settings page, and enabled the PUSH event.
Immediately, the event was triggered and the build started. But something more happened:
SCM changes detected in foolscrate-v1dev. Triggering #4 Aug 31, 2016 11:13:59 AM FINE com.cloudbees.jenkins.GitHubWebHook$1 apply Calling registerHooks() for foolscrate-v1dev Aug 31, 2016 11:13:59 AM INFO org.jenkinsci.plugins.github.webhook.WebhookManager$1 run GitHub webhooks activated for job foolscrate-v1dev with [GitHubRepositoryName[host=github.com,username=alanfranz,repository=foolscrate]] (events: [PUSH, REPOSITORY]) Aug 31, 2016 11:13:59 AM FINE org.jenkinsci.plugins.github.webhook.WebhookManager$3 applyNullSafe Created hook https://api.github.com/repos/alanfranz/foolscrate/hooks/9722695 (events: [PUSH, REPOSITORY])
That happened WITHOUT me editing the job itself again (I had committed changes to the Jenkinsfile, by the way), and now the hook seemed to register properly.
My final request:
I'm not sure whether this is a bug; the pipeline job should now be the "way to go" for new Jenkins job. Can we get a CLEAR documentation of what we should or shouldn't do, in either the Jenkins page or the Jenkinsfile, in order to make Github push events to work?
Thank you very much!
- blocks
-
JENKINS-41790 GitHub organization Webhook is not re-registered after deleting webhook on github
- Closed
- duplicates
-
JENKINS-33228 GitHub server configuration undocumented / duplicated
- Open
- is duplicated by
-
JENKINS-42154 Triggering branch indexing on pull request creation
- Resolved
-
JENKINS-42172 After migration from org plugin to github-branch-source every GitHub hook events are being ignored
- Closed
- is related to
-
JENKINS-38944 webhook is not registering on creation
- Closed
-
JENKINS-39025 Pull request from forks are not build
- Resolved