简体   繁体   English

Jenkins 在多个分支更改时触发作业

[英]Jenkins trigger Job on multiple branch changes

I want to build a Jenkins job when a change was done (merged) in multiple branches.当在多个分支中完成(合并)更改时,我想构建一个 Jenkins 作业。

What I tried was to configure "Source Code Management" with GIT,我尝试的是使用 GIT 配置“源代码管理”,

Branch Specifier: */release/*, */hotfix/*, */dev but it don't want to build.分支说明符: */release/*, */hotfix/*, */dev但它不想构建。

For build trigger I use "pull scm"对于构建触发器,我使用“pull scm”

Does anyone know how I can implemnt this有谁知道我怎么能实现这个

Keep in mind about wildcards (*) that 请记住有关通配符(*)的信息

The syntax is of the form: REPOSITORYNAME/BRANCH. 语法格式为:REPOSITORYNAME / BRANCH。 In addition, BRANCH is recognized as a shorthand of */BRANCH, * is recognized as a wildcard, and ** is recognized as wildcard that includes the separator '/'. 此外,BRANCH被识别为* / BRANCH的简写,*被识别为通配符,而**被识别为包含分隔符'/'的通配符。 Therefore, origin/branches* would match origin/branches-foo but not origin/branches/foo, while origin/branches** would match both origin/branches-foo and origin/branches/foo. 因此,origin / branches *将匹配origin / branches-foo,但不匹配origin / branches / foo,而origin / branches **将匹配origin / branches-foo和origin / branches / foo。

Try to use regular expression as branch specifier 尝试使用正则表达式作为分支说明符

:(release|hotfix|dev)

See documentation for details: 有关详细信息,请参见文档:

The syntax is of the form: :regexp. 语法的形式为::regexp。 Regular expression syntax in branches to build will only build those branches whose names match the regular expression. 要构建的分支中的正则表达式语法只会构建名称与正则表达式匹配的那些分支。

Branch specifier to match multiple branches with wildcard (Regular expression)用通配符匹配多个分支的分支说明符(正则表达式)

:(.*feature\/.*|.*release\/.*)

This would match: origin/feature/... or origin/release/...这将匹配: origin/feature/...origin/release/...

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

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