Configure Github Web Hook For Jenkins

0 Comment

Configure Github Web Hook For Jenkins

web hooks are used to notify instantly whenever any changes happened in server. if any changes happens in git hub it will the send request to client, in our scenario Jenkins is our client.

git hub web hook is used in Jenkins to build the jobs whenever any changes happens in git hub code repository. GitHub will the push request to Jenkins. and Jenkins will trigger the jobs which are configured as GitHub hook trigger in build triggers of Jenkins jobs. in the below steps i will show you how to configure git hub web hooks for Jenkins step by step.

Configure GitHub web hook for Jenkins

in your git hub code repository go to =>settings go to =>web hooks click on =>add web hooks.

Configure Github Web Hook For Jenkins

enter URL of  jenkins server in playload URL as  jenkinsurl/github-webhook/

ex http://52.54.125.117:8080/github-webhook/

Make sure that your Jenkins playload URL should end with /(slash) otherwise you will get errors. and web hook will not work as expected.

in content type select application/Jenkins

Leave “Secret” blank (unless a secret has been created and configured in the Jenkins “Manage Jenkins -> Configure System -> GitHub Servers” section)

Which events would you like to trigger this web hook?
select anyone in this according to your needs and make sure that active is checked.

Click click on “Add Webhook”

Configure GitHub web hook in  Jenkins

Go to build trigger section in Jenkins job configuration and select GitHub hook trigger for GITScm polling.

jenkins github webhook

by selecting this trigger, this job will run whenever Jenkins receive git hub web hook request from git hub. Git hub web hook will send request according to your choices which you selected in “which events would you like to trigger this web hook” option in git hub web hooks.
That’s all we have successfully configured git hub web hook for Jenkins.

NOTE:
Make sure that allow 8080 port of Jenkins from git hub server in your security groups or firewalls. If you have not allowed, github webhook request will not reach jenkins server and this web hook concept will not workout.

github webhook jenkins

 

  • configure git hub web hook for Jenkins
  • Jenkins git hub web hook payload
  • Jenkins web hook git hub configuration
  • git hub hook trigger for gitscm polling
  • Jenkins git hub hook trigger for gitscm polling
[top]

Leave a Reply

Your email address will not be published. Required fields are marked *