Trigger build only on pushes to master

大兔子大兔子 提交于 2020-06-25 08:21:27

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/33113400/trigger-build-only-on-pushes-to-master

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!