简体   繁体   English

如何排除要在詹金斯建立的分支

[英]How to exclude branches to build in jenkins

In Source Code Management tab, I could specify branch specifier to track /feature/AEAZ-* branchs in a repository. 在“源代码管理”选项卡中,我可以指定分支说明符以跟踪存储库中的/feature/AEAZ-*分支。 It will track all branches whose name include /feature/AEAZ- . 它将跟踪名称包括/feature/AEAZ-所有分支。 Now I want to exclude some branches like /feature/AEAZ-1234 which includes /feature/AEAZ- . 现在我需要排除一些分支机构/feature/AEAZ-1234 ,其中包括/feature/AEAZ-
How to specify branch specifier? 如何指定分支说明符?
Jenkins Git plugin says it can use regular expression . Jenkins Git插件表示可以使用正则表达式 I'm not familar with it. 我不熟悉。 Could you tell me how to implement this requirement? 您能告诉我如何执行此要求吗?

Could I use :/feature/AEAZ-(?!(1234)).* to exclude /feature/AEAZ-1234 ? 我可以使用:/feature/AEAZ-(?!(1234)).*排除/feature/AEAZ-1234吗?

You could try something like 您可以尝试类似

/\/feature\/AEAZ\-(?!1234).*/

notes : 注意事项:

  • Characters like / or - have to be escaped with a \\ to be considered as simple chars without their special behaviour in regexp patterns. 像/或-这样的字符必须用\\进行转义,才能被视为简单的字符,而在regexp模式中没有特殊的行为。
  • (?!something) to exclude something trailing (?!something)排除尾随的something
  • The outer / I've put around the regexp may not be needed in jenkins UI Jenkins UI中可能不需要外部/我已经放在正则表达式周围

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

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