繁体   English   中英

Jenkins Bitbucket Branch Source Plugin如何只构建master和PR?

[英]Jenkins Bitbucket Branch Source Plugin how to build only master and PR?

我正在使用Jenkins 2和Bitbucket Branch Source Plugin来扫描和构建所有的分支和PR。

我的问题是,当我将代码推送到PR时,分支被构建两次(一个用于分支,一个用于PR)。 我想只建立大师和PR。

有人知道怎么做吗? 我找不到任何关于此的文档。

Branch Indexing Log (没有过滤器):

Checking branch branch-name from repo/project
Met criteria
Scheduled build for branch: branch-name
...
Checking PR from repo/project and branch branch-name
Met criteria
Scheduled build for branch: PR-123

然后,当我尝试过滤PR- *时,没有扫描任何内容。 我得到:

Checking branch branch-name from repo/project

您可以使用空格分隔您的条款。 对于您的包含尝试:

master PR-*

在配置Bitbucket源时,可以使用Include branchesExclude branches (在Advanced参数中)来包含/排除某些分支:

在此输入图像描述

并且基于Bitbucket Branch源插件源代码 ,这两个字段都采用Ant正则表达式

因此,假设所有PR分支以“ pr- ”开头,您可以在include branches使用正则表达式,例如:

(?:master|pr-).*

暂无
暂无

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

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