2

I tried to follow the instructions in this article:

http://developer.cloudbees.com/bin/view/DEV/GitHub+Commit+Hooks+HOWTO

But I have two problems:

  1. It doesn't work. When I push to github nothing happens on the jenkins side. On Jenkins the GitHub Hook log says 'Polling has not run yet.'

  2. The possible cause for this is that I can't specify the git repository as described in this image:

enter image description here

There is no textfield for a public key, nor the other fields. Instead I have the fields

Repository URL, Name, Refspec

Also I can specify a http url (and everything but the triggering works). But if I specify the git/ssh url as in the image I get the following error:

Failed to connect to repository : Command "git ls-remote -h [email protected]:schauder/degraph.git HEAD" returned status code 128: stdout: stderr: Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

I copied the url from github so a typo is somewhat unlikely.

I verified that I have the github plugin installed (upgraded to version 1.5)

Any hints how to fix or at least debug the problem?

Update answering questions in the comments:

Yes I checked the checkbox 'Build when a change is pushed to GitHub' in the job configuration.

And Yes I setup the webhook in GitHub. When I click the test button there, nothing happens. When I put the url from the webhook in my browser I get a http 500 saying

Not intended to be browsed interactively (must specify payload parameter)

Plus some lengthy stacktrace.

Another Update

I checked the GIT related plugins installed on the Jenkins side. Everything showing their with GIT in the text is installed and at the most current version

5
  • Just to verify: 1) Did you check the checkbox "Build when a change is pushed to GitHub" under BuildTrigger in your Jenkins job? 2) Did you register the service hook under Settings | Service Hooks | WebHook URLs in your GitHub project? Mar 15, 2013 at 10:19
  • Yes, I did that. See update of the question. Mar 15, 2013 at 11:00
  • Based on Git error message above, I assume you can't be authenticated. Did you add the CloudBees public SSH key on GitHub as described here? Mar 15, 2013 at 11:15
  • Ok, I think I found the public key (in Jenkins) and put it in Github. Now I can specify an SSH URL to the github repository. But there is still no triggering happening. Mar 15, 2013 at 12:13
  • Actually the triggering does work, after setting up the key. Not sure why my first test seemed to fail. Mar 15, 2013 at 13:19

2 Answers 2

3

Based on Git error message above, I assume you can't be authenticated. Did you add the CloudBees public SSH key on GitHub as described here?

Clarification by OP

The image referenced in the question seemed to suggest that one puts a public key from GitHub into CloudBees. But actually it is the other way round, and also all the labels seem to be changed, so it is kind of difficult to match that screenshot to what you see in CloudBees.

So what I did is this:

  • in the Job configuration at Cloudbees there is a Public Key (generated by CloudBee). I it in the CloudBees DEV@cloud Authorization section and labeled CloudBees Public Key. Copy that Key.

  • Hop over to GitHub and go to Settings > Deploy Keys. Add the key there.

  • go to Settings > Service Hooks > WebHook URLs. Click on the test button. You are not going to see much on the GitHub side.

  • Hop back to CloudBees Jenkins. From the main page of the job go to the ´GitHub Hook Log´. There you should see something like:

    Started on Mar 15, 2013 8:55:14 AM
    Using strategy: Default
    [poll] Last Built Revision: Revision 581acde89a62317fd8dabaa3f4c6025d1c9dd413     (origin/master)
    Fetching changes from the remote Git repositories
    Polling for changes in
    Done. Took 0.34 sec
    Changes found
    

    And your job should start.

    If the last line says No Changes this means the hook worked, but you already build the current version so the build is not triggered again.

  • If you still have problems, have look at https://wiki.jenkins-ci.org/display/JENKINS/Github+Plugin#GitHubPlugin-TriggerabuildwhenachangeispushedtoGitHub under 'trouble shooting' it tells you how to set up logging on the jenkins side. With this I get all kind of stuff in the Jenkins SystemLog.

0

I've just published a tutorial on continuous integration for Play applications hosted on GitHub using CloudBees. This is intended to provide a comprehensive guide:

http://ics-software-engineering.github.io/play-example-continuous-integration/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.