2017-07-21 5 views
2

現在、以下に示す設定を使用して、Jenkinsはmasterとすべての*-previewブランチを構築します。 ブランチを使用してのブランチを作成すると、残りの*-previewブランチをビルドするときに、exclude-this-branch-previewのように単一の*-previewブランチを除外することは可能ですか?作成するJenkinsブランチ - 単一ブランチを除外

enter image description here

答えて

3

あなたが助けから

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

前にセミコロンを指定することで、正規表現を使用することができます?^(?!除外-this-:先頭の ``に `を何

:<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 
+0

ブランチプレビュー)。* - プレビュー$ 'を意味する? – DanCat

+1

@DanCat '?!'は負の先読みで、基本的には一致してはいけません。 https://stackoverflow.com/questions/12210807/what-does-mean – Cole9350

2
:^(?!(<the branch name to be excluded with out angular braces>)).* 

SCMポーリングを構築し、試してみ支店でこれを入れてください。その正規表現は、自明です。

関連する問題