Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 628
vaibhavcool20 Avatar asked Mar 30 '15 12:03

vaibhavcool20


Video Answer


2 Answers

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

like image 59
Josue Abarca Avatar answered Sep 27 '22 21:09

Josue Abarca


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)

like image 41
Harby Avatar answered Sep 27 '22 22:09

Harby