简体   繁体   English

Jenkins构建特定分支(jenkins git插件)

[英]Jenkins Build off specific branches (jenkins git plugin)

I am trying to use 我正在尝试使用

<branches>
    <hudson.plugins.git.BranchSpec>
        <name>refs/heads/master</name>
    </hudson.plugins.git.BranchSpec>
</branches>

in my config.xml 在我的config.xml中

Which means I am intending to build only commits of master, but apparently jenkins seems to build from commits to any other branches too. 这意味着我打算只构建master的提交,但显然詹金斯似乎也从提交构建到其他分支。 I am not sure what I am doing wrong to accomplish this. 我不确定要为此做错什么。 Any help is appreciated. 任何帮助表示赞赏。

PS: Using the jenkins Git plugin PS:使用jenkins Git插件

You only need the branch name without the refs 您只需要没有引用的分支名称

<branches>
    <hudson.plugins.git.BranchSpec>
        <name>origin/master</name>
    </hudson.plugins.git.BranchSpec>
</branches>

Or for local branch: 或对于本地分支机构:

<branches>
    <hudson.plugins.git.BranchSpec>
        <name>master</name>
    </hudson.plugins.git.BranchSpec>
</branches>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM