Setting up a Jenkins job in the jclouds DEV@cloud account to trigger on Pull Requests is a three-step process:  

  1. Configure the Jenkins job in DEV@cloud 
  2. Create the Service Hook in GitHub 

  3. Configure the Service Hook via the GitHub API


DEV@cloud Account

If you don't have a DEV@cloud account with rights to create Jenkins jobs for jclouds, plesae send an email to the dev list requesting access.  

Admin Rights in GitHub

You'll need to be able to administer the GitHub repo for which you're looking to create a pull request job. If you can see the Settings link for the repo, you should be OK.  

Configuring the Jenkins Job

Log in to the jclouds DEV@cloud account and create a new job on the pull requests tab. Your best bet is to clone of the existing pull request jobs and modify the source repository.  

There are three things you need to ensure:  

  1. The source repository and branch are correct 
  2. Git validated merge support is enabled Git validated merge support option 

  3. Build pull requests to the repository is the only build trigger Build pull requests to the repository trigger  


Creating the GitHub Service Hook  

Go to the Settings > Service Hooks menu and create a new WebHook URLs entry pointing at  

GitHub WebHook URL  

Configuring the Service Hook

Unfortunately, the Service Hook we have just created listens to the wrong repository event (push instead of pull_request) and sends the wrong type of data, and that's not (yet) something we can change via the GitHub site. We'll use the GitHub HTTP API instead.  

  1. Download the attached json-body.txt 

  2. Find the URL of the hook to be modified by running  

    curl -k -u <your-github-user>:<your-github-pass><github-account>/<repo>/hooks

    e.g. curl -k -u myuser:secret Look for the id of the hook whose config > url attribute is 

  3. Update the hook by running  

    curl -k -u <your-github-user>:<your-github-pass> -d @<path-to-downloaded-json-body> -X PATCH<github-account>/<repo>/hooks/<id-from-step-2>

    e.g. curl -k -u myuser:secret -d @/tmp/json.body -X PATCH  

The output of the last command should be something like

  "url": "",
  "test_url": "",
  "id": 123456,
  "name": "web",
  "active": true,
  "events": [
  "config": {
    "url": ""
  "last_response": {
    "code": 200,
    "status": "ok",
    "message": "OK"
  "updated_at": "2013-06-25T04:50:23Z",
  "created_at": "2013-05-22T09:20:48Z"
  • No labels