Git – Jenkins web hook

I’ve a public Git repository – https://github.com/sangitaccount/Test and wants to hook it to Jenkins so that any commits + push to master branch should execute a job in Jenkins. Two options available.

Option 1: Go to Repository in Git -> Settings -> Integration & Services

Git_Service

Add service -> Search for Jenkins ( GitHub plugin ) -> Add Jenkins URL with /github-webhook/ as shown below.

Git_Webhook

Option 2: Go to Repository in Git -> Settings -> Webhooks

Git_Settings_Webhook

Add webhook -> Add Jenkins URL with /github-webhook/ as shown below.

Git_Webhook2

As soon as I;ve added RED WARNING mark seen but once I push the changes to repository it turned green.

Git_Webhook_Deliveries.JPG

Now go to Jenkins -> Job -> Provide the GIT repository under SCM -> Build Triggers

Jenkins_Git

 

Jenkins_Build_Trigger.JPG

Now pushing the changes to master branch – triggering the job in Jenkins.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s