github webhook

Run a Jenkins job with GitHub webhook

Pre-requisites

Integration Steps

Log into the Jenkins.

1

Create a Freestyle Project

  • Create a new job

    • Job Name: WebhookTestJob

    • Source code management

    • Build Triggers

      • Enable: GitHub hook trigger for GITScm polling

  • Build

    • Click Add Build StepInvoke Top Level Maven Targets

      • Maven Version: Maven

      • Goals: clean install

2

Configure the GitHub repository webhook

On your GitHub repository:

  • Go to SettingsWebhooks

  • Add a webhook:

    • Payload URL: http://<Jenkins_IP>:8080/github-webhook/

    • Content type: application/json

3

Trigger the job

  • Update the repository (push a new commit). This should trigger the Jenkins job via the webhook.