1

I try to follow several links and youtube video, example : jenkins module

I tried several different ways to configure the settings but when I push change to github, jenkins don't build the maven project automatically. However, from jenkins, I can build manually the project (so, there isn't problem between jenkins and my github)

Specifically, here are my current settings :

In Jenkins > manage Jenkins > Configure Systems > GitHub Web Hook block : IMAGE

"Let Jenkins auto-manage hooks URLs" selected

Username : mygithubname

OAuth token : the token generated from github

In Github : global settings > personnal access tokens > my "jenkins" OAuth token : IMAGE my repository > settings > Webhooks & Services > my "jenkins" service added IMAGE

But I see an error in my repository > settings > Webhooks & services "Last delivery was not successful. Service Timeout" IMAGE

I come back in my jenkins settings :

Jenkins > Configure Global Security : Enable security unchecked (nothing is checked in this page), I try to create a jenkins user like I see in some web tutorials..but with no success

Jenkins > my maven project > configuration : IMAGE

Repository URL : https://github.com/mygithubname/myrepository.git

Credential : mygithubname/mygithubpassword

and "Build when a change is pushed to github checked

So..with this settings, where is my mistake ? Thank you =)

spacecodeur
  • 2,206
  • 7
  • 35
  • 71

2 Answers2

0

I wrote a blogpost with exact steps some time ago how to integrate Jenkins Github plugin with Github.

Scroll down to section "2. Jenkins – GitHub integration".

Differences I noticed between your and my approach:

  1. I filled API URL in Github Web Hook section in Jenkins and didn't use username.
  2. I didn't fill credentials in Jenkins job
  3. Checked build trigger "Build when a change is pushed to Github" in Jenkins job
luboskrnac
  • 23,973
  • 10
  • 81
  • 92
  • I test this changes, I push a new file...but nothing happen in jenkins :/ If I can, I will follow your tutorial – spacecodeur Jun 18 '15 at 20:59
0

What's the jenkins hook url you filled in the Github repo?

Github webhook mechanism rely on a public IP or DNS to work. So if you use http://localhost:8080/github-webhook or http://127.0.0.1:8080/github-webhook then it certainly not work, because Github not able to find where your jenkins is.

mainframer
  • 20,411
  • 12
  • 49
  • 68
  • Any solution to overcome the same? – Arpit Aggarwal Jun 14 '15 at 10:59
  • I have answered this question days ago, and you can feel free to take a look for the possible solutions http://stackoverflow.com/questions/30576881/jenkins-build-when-a-change-is-pushed-to-github-option-is-not-working/30577823#30577823 – mainframer Jun 14 '15 at 11:03
  • 1
    Because you are specifying this kind of url in Github. So Github will treat either `localhost:8080` and `127.0.0.1:8080` to itself, not your jenkins server. You should specify a public IP or DNS in order to get the Github webhook work. In other word, you should make sure Github can find your jenkins server from the internet. Both `localhost` and `127.0.0.1` are invalid public address for other machines to look up. – mainframer Jun 14 '15 at 11:26
  • In webhook github settings, the url used is the good (ip fixed of the jenkins server, with this ip I can access to my jenkins server from any computer/connection), not a local url – spacecodeur Jun 18 '15 at 20:48