How to trigger a Jenkins build when a push is made to a private github repository

前端 未结 2 470
傲寒
傲寒 2021-02-05 09:17

My Jenkins Continuous Integration Server is on running on a Ubuntu host, configured as follows:

  • Jenkins v 1.463
  • github-api 1.23
  • Jenkins GIT plugi
相关标签:
2条回答
  • 2021-02-05 09:42

    I had a similar problem, and after looking at the main Jenkins System Log I saw the following:

    Feb 15, 2013 8:35:44 PM hudson.security.csrf.CrumbFilter doFilter
    WARNING: No valid crumb was included in request for /github-webhook/.  Returning 403.
    

    The solution is to switch off the CSRF protection - Manage Jenkins > Configure System > Prevent Cross Site Request Forgery exploits. The checkbox is just at the bottom of the first configuration section. After that it all seemed to work happily.

    0 讨论(0)
  • 2021-02-05 09:45

    Create a logger with trace level logging for the com.cloudbees.jenkins category under your /log url (Manage Jenkins-> System logs).

    Verify that there is a Webhook URL entry under the Service Hooks section of your repository administration screen.

    Click test hook and you should see some log activity under your newly created logger.

    Finally, check the GitHub Polling log action on the build which you have configured to be triggered by GitHub pushes.

    A common mistake is testing commit hooks like this without having a change present.

    The hook is only used to prompt a poll and won't perform a build unless changes are detected.

    0 讨论(0)
提交回复
热议问题