Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger build only on pushes to master

I am using Jenkins with the Github Plugin I have integrated it using GitHub's webhooks and it works like a charm, except that builds get triggered everytime something is pushed to the repository.

Is there a way to limit builds only when a change to the remote branch master has been made?

like image 640
Mahoni Avatar asked Oct 13 '15 22:10

Mahoni


1 Answers

Action Plan

  • Open the Jenkins job Configuration
  • Go to the section Source Code Managment
  • In the Git section
    • For the field Branches to build add the value */master

This tells this Jenkins Job, to only execute the job, when something is pushed to the branch master.

Figure: Shows the configuration, for building only branch master.

enter image description here

like image 134
Verhagen Avatar answered Oct 04 '22 02:10

Verhagen