Git-hub Webhook Setup

Git-hub Webhook Setup

Step 1: Jenkins Job Creation

No alt text provided for this image
No alt text provided for this image

Step: Web-hook connection setup

To get the web-hook successfully run we need to copy a public-key of a controller on which Jenkins is installed and copy to deploy-keys of repository

We save private key to Jenkins credentials and put a public key in githhub-repo deploy keys to connect successfully to each other.

No alt text provided for this image

 Eg . private key i.e id_rsa is like below:

-----BEGIN RSA PRIVATE KEY-----

MIIEpAIBAAKCAQEA2wnTRjQACIr0U0sF2SPUH9O1nGs2SPyc4SWbeQhh73UGd07+

MIIEpAIBAAKCAQEA2wnTRjQACIr0U0sF2SPUH9O1nGs2SPyc4SWbeQhh73UGd07

-----END RSA PRIVATE KEY-----

Step : Goto to git-hub.com and goto repo settings

No alt text provided for this image

 WEBHOOK Setting in Git-hub repo

No alt text provided for this image

Step : Now to check step by step process working push some new code to git hub

Push command used :

git push origin HEAD:masterSteps to verify

1: upload some images in images folder of git repo from slave1 machine

2: Now change the image name in index.html

sudo nano index.html

3: now run below commands:

git add index.html

git commit -m "the data added"

git push origin HEAD:master

4: Once the push is successful check in Jenkins the job will automatically executed looks like below:

No alt text provided for this image

5: Goto browser and check the changes

To view or add a comment, sign in

More articles by Monish Bhanushali

  • Terraform Basics With Example

    Terraform – Basics Installing Locally and Running with Example Step 1: For Terafform to work with AWS cloud we require…

    2 Comments

Explore content categories