I need help setting up a github webhook with a localhost jenkins

14,694

Solution 1

If you want to start a build when a change is pushed to GitHub you need to configure the Github's Webhook: Head over to the GitHub repo and click Settings. Click the Webhooks & Services tab, and then the Add service drop-down. Select the Jenkins (GitHub plugin) service. And finally, your Jenkins hook url:

http://JENKINS.SERVER.IP.ADDRESS:8080/github-webhook/

Therefore, you need a public IP address or DNS for allowing GitHub to trigger your Jenkins build.

Solution 2

There is an option in jenkins under "Build Triggers" where you can check off the "Build when a change is pushed to GitHub". This will poll the github repository for any change. If any change is found, a build will be triggered automatically.

Build Triggers

You can configure the schedule to poll SCM as well.

Share:
14,694
jackoo
Author by

jackoo

Updated on July 20, 2022

Comments

  • jackoo
    jackoo almost 2 years

    I have: - a public github repository - a localhost:8080 jenkins - a java maven project connected to the github repository - a jenkins job connected to the github repo I am able to trigger manual builds anytime, but I want to have a build triggered at each commit pushed to the github repository.

  • jackoo
    jackoo over 8 years
    The option "Build when a change is pushed to GitHub" is checked but no build is triggered, and that's where I'm stuck.
  • Atri
    Atri over 8 years
    Did you setup the config for git under "Source code management"? Could you please update your question with a screenshot of the jenkins config that you have?
  • Atri
    Atri over 8 years
    you have the wrong repository url, it should end with .git. I think this is what you are looking for https://github.com/gneamt/mavg.git