Difference between revisions of "GitHub/Jenkins: Setting up Webhooks"

From Gcube Wiki
Jump to: navigation, search
(No difference)

Revision as of 01:35, 26 November 2019

Requirements

Prepare Github repository

We need to add a service to call the Jenkins Github webhook on a push, to do this go to settings -> integrations & Services and add a new service. The Jenkins Github plugin service should be in the list of available services.

Enter the URL of your Jenkins instance followed by /github-webhook/

Update Jenkins job with Github configuration

In the ‘General’ section of the job configuration check the Github project tick box and enter the URL to the repository that you configured in step 2.

Next update the Source Code Management section, first set the repository URL (note the format git@github.com:{YOUR_REPO}. You can also specify the branch you would like to use.

The last step is to tell Jenkins to build when the Github hook is called, select the highlighted option below in the Build Triggers section.

That’s it! Your Jenkins build should now be triggered whenever a push is made to your repository.