Git-hub Webhook Setup
Step 1: Jenkins Job Creation
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.
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
WEBHOOK Setting in Git-hub repo
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:
5: Goto browser and check the changes