not been able to make Jenkins trigger a build when changes are pushed to Github

13,024

Solution 1

Since your jenkins is not accessible from a public IP address, GitHub can not trigger the build via WebHook.

The alternative is to use the "Polling" mechanism, to check for changes every X minutes, for example:

enter image description here

Solution 2

I suppose you can webhook even your local machine using services that provide tunnels from some endpoint on the web and the local Jenkins installation. Like, UltraHook, for instance. I've solved the same problem using these steps:

  • Register on UltraHook (it is free) and get your API key and domain in the system
  • Install UltraHook gem on your local machine:

    gem install ultrahook

  • In GitHub repository specify the URL to send a webhook to. It should be the URL provided by UltraHook (like http://repository_name.your_subdomain.ultrahook.com)
  • Run ultrahook on the local machine and you are done:

    ultrahook [-k ] subdomain destination

However, other solutions, like ngrok.com might be more reliable (at least it has no problems with long uptimes, unlike the ultrahook)

Share:
13,024
vaibhavcool20
Author by

vaibhavcool20

Updated on July 03, 2022

Comments

  • vaibhavcool20
    vaibhavcool20 almost 2 years

    their are a lot of question like this but none seem to work.

    I am running jenkins on http://localhost:1001/ and have added the authorization token from github into jenkins and it seems to work.

    I can build the project manually and when i push some thing onto the github and build the project again changes are made but

    I am not been able to do this automatically via webhook.

    when I open last github log this is the output

    Polling has not run yet

    in configuration of project I have put

    enter image description here

    PS: don't worry that i have posted the link repo because their is nothing much in repo.

    PPS: installed all the plug ins and build trigger is on Build when a change is pushed to GitHub