git - 要构建的 Jenkins 分支 - 排除单个分支

标签 git jenkins

目前,Jenkins 使用下面显示的设置构建 master 和所有 *-preview 分支。使用分支构建,Jenkins 是否可以排除单个 *-preview 分支,例如 exclude-this-branch-在构建所有剩余的 *-preview 分支时预览

enter image description here

最佳答案

您可以通过在前面指定分号来使用正则表达式

:^(?!exclude-this-branch-preview).*-preview$

来自帮助:

:<regular expression>
The syntax is of the form: :regexp. Regular expression syntax in branches to 
build will only build those branches whose names match the regular expression.
Examples:
:^(?!(origin/prefix)).*
    matches: origin or origin/master or origin/feature
    does not match: origin/prefix or origin/prefix_123 or origin/prefix-abc
:origin/release-\d{8}
    matches: origin/release-20150101
    does not match: origin/release-2015010 or origin/release-201501011 or 
    origin/release-20150101-something
:^(?!origin/master$|origin/develop$).*
    matches: origin/branch1 or origin/branch-2 or origin/master123 or 
    origin/develop-123
    does not match: origin/master or origin/develop

关于git - 要构建的 Jenkins 分支 - 排除单个分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45243512/

相关文章:

django - 我应该如何暂存我的 bitbucket + heroku django 应用程序以进行开发和部署?

git - 如何在使用 "git merge -s ours"选项完成的历史记录中查找 merge 提交?

eclipse - 如何将 Eclipse 工作区与 git 本地存储库隔离?

Jenkins 管道用户输入 - 如果中止则操作

Jenkins 构建日志已编码子作业/项目的 URL

jenkins - 使用 Jenkins 插件更新 confluence wiki 中的表

git - 在 git 中使用 mergerequests 和 releasenotes 时不断发生冲突

git 推送错误 : Server aborted the SSL handshake

使用 EMMA 的 Sonar 的 Delphi 代码覆盖率

jenkins - 运行 testcafe 和 browserstack 时获取 "Unable to establish one or more of the specified browser connections"