I need help setting up a github webhook with a localhost jenkins
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.
You can configure the schedule to poll SCM as well.
jackoo
Updated on July 20, 2022Comments
-
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 over 8 yearsThe option "Build when a change is pushed to GitHub" is checked but no build is triggered, and that's where I'm stuck.
-
Atri over 8 yearsDid 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 over 8 yearsyou have the wrong repository url, it should end with
.git
. I think this is what you are looking forhttps://github.com/gneamt/mavg.git