How to auto build a job in jenkins if there is any change in code on Github repository?

0 votes
I want Jenkins to automatically build a job as soon as there is a change in the code on github. With polling jenkins checks if there is a change in the code. I don't want that. If there is a change in the code jenkins should be notified about the change and then it should auto build. Is this possible?
Jun 20 in Jenkins by Neel
• 1,390 points
47 views

1 answer to this question.

0 votes

Yes this is possible. Follow these steps.

1. Open Jenkins dashboard. Click on manage jenkins

2. Click on Configure system and under github configuration click advanced tab.

3. Check 'Specify another hook url' for GitHub configuration. 

4. Now you will get a url in the textbox. Copy this url as it is required in the next steps.

5. Now open your github repository. Go to settings -> webhooks -> add webhooks.

6. Now paste the url from step 4 in the payload url section. Next click on just push the event Now you should be able to see the added webhook in the list of webhooks.

7. Now go to jenkins dashboard. Go to your project configuration. In the build triggers section select github hook trigger for git scm polling. Save the changes.

answered Jun 20 by Arvind
• 1,370 points

Related Questions In Jenkins

0 votes
1 answer
+1 vote
4 answers
+1 vote
1 answer

Is there a way to restrict permissions to a user per individual job in jenkins?

Yes, you can configure user permissions per ...READ MORE

answered May 28 in Jenkins by Sirajul
• 4,880 points

edited May 28 by Sirajul 53 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

How to disable or reset security settings in Jenkins?

Go to config.xml file in var/lib/jenkins. In ...READ MORE

answered Jun 18 in Jenkins by Arvind
• 1,370 points
17 views
0 votes
1 answer

How do I schedule job periodically in Jenkins?

I think the expression * 1 * ...READ MORE

answered Jun 18 in Jenkins by Arvind
• 1,370 points
22 views