summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoramit lin <amitl@totango.com>2019-01-07 16:47:25 +0200
committeramit lin <amitl@totango.com>2019-01-07 18:12:29 +0200
commitff338dc948d5fec0ba7c3ced1f3630e00890b426 (patch)
tree0d416c8c1aeab0a84970f059bb0d4a1d639ae29e /tests
parentb1499530dbb5ad66f52fbfc4ffa1343da79df441 (diff)
downloadpython-jenkins-job-builder-ff338dc948d5fec0ba7c3ced1f3630e00890b426.tar.gz
python-jenkins-job-builder-ff338dc948d5fec0ba7c3ced1f3630e00890b426.tar.xz
python-jenkins-job-builder-ff338dc948d5fec0ba7c3ced1f3630e00890b426.zip
Adds github scm multibranch regex branch filter
This commit adds the ability to filter discovered branches in a multibranch project using a regex filter. This is done by adding a 'head-filter-regex' key in the github scm configuration inside the multibranch job yaml - it maps to a <jenkins.scm.impl.trait.RegexSCMHeadFilterTrait> element containing a <regex> element in the resulting job. Change-Id: I8c88a8b131cdc51d2c8abb13397637ebbf6d1373 Signed-off-by: amit lin <amitl@totango.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/multibranch/fixtures/scm_github_full.xml3
-rw-r--r--tests/multibranch/fixtures/scm_github_full.yaml1
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/multibranch/fixtures/scm_github_full.xml b/tests/multibranch/fixtures/scm_github_full.xml
index a74e2e6d..cc4efcc1 100644
--- a/tests/multibranch/fixtures/scm_github_full.xml
+++ b/tests/multibranch/fixtures/scm_github_full.xml
@@ -52,6 +52,9 @@
<org.jenkinsci.plugins.github__branch__source.OriginPullRequestDiscoveryTrait>
<strategyId>3</strategyId>
</org.jenkinsci.plugins.github__branch__source.OriginPullRequestDiscoveryTrait>
+ <jenkins.scm.impl.trait.RegexSCMHeadFilterTrait>
+ <regex>(.*/master|.*/release/.*)</regex>
+ </jenkins.scm.impl.trait.RegexSCMHeadFilterTrait>
<jenkins.plugins.git.traits.CleanAfterCheckoutTrait>
<extension class="hudson.plugins.git.extensions.impl.CleanCheckout"/>
</jenkins.plugins.git.traits.CleanAfterCheckoutTrait>
diff --git a/tests/multibranch/fixtures/scm_github_full.yaml b/tests/multibranch/fixtures/scm_github_full.yaml
index 9b74e837..a45ecb65 100644
--- a/tests/multibranch/fixtures/scm_github_full.yaml
+++ b/tests/multibranch/fixtures/scm_github_full.yaml
@@ -10,6 +10,7 @@ scm:
repo-owner: example-owner
credentials-id: example-credential
branch-discovery: all
+ head-filter-regex: "(.*/master|.*/release/.*)"
discover-pr-forks-strategy: both
discover-pr-forks-trust: everyone
discover-pr-origin: both