Build only the Git branch that has been pushed to

前端 未结 6 659
时光说笑
时光说笑 2020-12-09 02:43

I have a Jenkins job to build the master branch of my GitHub repo. It triggers nicely when I push a commit to master, and I\'m very happy about it.

6条回答
  •  甜味超标
    2020-12-09 03:44

    As @thatway_3 mentioned, this is possible with a plugin. The Multi-Branch Project Plugin that they linked to is deprecated, but you can use the Pipeline Multibranch Plugin instead.

    If you install that plugin and then create a new job of type "Pipeline Multibranch", you can configure that to track a particular repository. It will then (correctly!) build all branches from there.

    See also: https://jenkins.io/blog/2015/12/03/pipeline-as-code-with-multibranch-workflows-in-jenkins/

    Hope this helps.

提交回复
热议问题