diff options
author | sbussetti <steve.bussetti@gmail.com> | 2018-11-26 15:57:13 -0500 |
---|---|---|
committer | sbussetti <steve.bussetti@gmail.com> | 2018-11-27 09:01:20 -0500 |
commit | dbbca01833954ce1f36646ad0905f57519939f22 (patch) | |
tree | 634efc67f52086cdf9986638f25e5642df61a48f /tests | |
parent | d29998eaa9c308bdc74e72e2d4dc9e3d70d80904 (diff) | |
download | python-jenkins-job-builder-dbbca01833954ce1f36646ad0905f57519939f22.tar.gz python-jenkins-job-builder-dbbca01833954ce1f36646ad0905f57519939f22.tar.xz python-jenkins-job-builder-dbbca01833954ce1f36646ad0905f57519939f22.zip |
Adds support for Property Strategies
Multibranch pipeline jobs also support "Property Strategy" elements.
These are fairly limited, but do contain the very useful "Suppress
automatic SCM triggering" trait. This commit adds support for
defining these for the "All branches get the same properties"
strategy, and could be easily amended to also support the "Named
branches get different properties" strategy in a future update.
Change-Id: I3d9281657e341260a23f357f6e247793379b0eed
Signed-off-by: sbussetti <steve.bussetti@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/multibranch/fixtures/scm_bitbucket_full.xml | 10 | ||||
-rw-r--r-- | tests/multibranch/fixtures/scm_bitbucket_full.yaml | 4 | ||||
-rw-r--r-- | tests/multibranch/fixtures/scm_gerrit_full.xml | 10 | ||||
-rw-r--r-- | tests/multibranch/fixtures/scm_gerrit_full.yaml | 4 | ||||
-rw-r--r-- | tests/multibranch/fixtures/scm_git_full.xml | 10 | ||||
-rw-r--r-- | tests/multibranch/fixtures/scm_git_full.yaml | 4 | ||||
-rw-r--r-- | tests/multibranch/fixtures/scm_github_full.xml | 10 | ||||
-rw-r--r-- | tests/multibranch/fixtures/scm_github_full.yaml | 4 |
8 files changed, 56 insertions, 0 deletions
diff --git a/tests/multibranch/fixtures/scm_bitbucket_full.xml b/tests/multibranch/fixtures/scm_bitbucket_full.xml index c7389335..3a32f7c1 100644 --- a/tests/multibranch/fixtures/scm_bitbucket_full.xml +++ b/tests/multibranch/fixtures/scm_bitbucket_full.xml @@ -104,6 +104,16 @@ </jenkins.plugins.git.traits.AuthorInChangelogTrait> </traits> </source> + <strategy class="jenkins.branch.DefaultBranchPropertyStrategy"> + <properties class="java.util.Arrays$ArrayList"> + <a class="jenkins.branch.BranchProperty-array"> + <jenkins.branch.NoTriggerBranchProperty/> + <org.jenkinsci.plugins.workflow.multibranch.DurabilityHintBranchProperty plugin="workflow-multibranch"> + <hint>MAX_SURVIVABILITY</hint> + </org.jenkinsci.plugins.workflow.multibranch.DurabilityHintBranchProperty> + </a> + </properties> + </strategy> <buildStrategies> <jenkins.branch.buildstrategies.basic.TagBuildStrategyImpl plugin="basic-branch-build-strategies"> <atMostMillis>86400000</atMostMillis> diff --git a/tests/multibranch/fixtures/scm_bitbucket_full.yaml b/tests/multibranch/fixtures/scm_bitbucket_full.yaml index 73c116e0..f203fb6e 100644 --- a/tests/multibranch/fixtures/scm_bitbucket_full.yaml +++ b/tests/multibranch/fixtures/scm_bitbucket_full.yaml @@ -19,6 +19,10 @@ scm: filter-by-name-wildcard: includes: '*' excludes: 'master' + property-strategies: + all-branches: + - suppress-scm-triggering: true + - pipeline-branch-durability-override: max-survivability build-strategies: - tags: ignore-tags-newer-than: 1 diff --git a/tests/multibranch/fixtures/scm_gerrit_full.xml b/tests/multibranch/fixtures/scm_gerrit_full.xml index 2c511acc..5ba878b0 100644 --- a/tests/multibranch/fixtures/scm_gerrit_full.xml +++ b/tests/multibranch/fixtures/scm_gerrit_full.xml @@ -49,6 +49,16 @@ </jenkins.plugins.git.traits.RefSpecsSCMSourceTrait> </traits> </source> + <strategy class="jenkins.branch.DefaultBranchPropertyStrategy"> + <properties class="java.util.Arrays$ArrayList"> + <a class="jenkins.branch.BranchProperty-array"> + <jenkins.branch.NoTriggerBranchProperty/> + <org.jenkinsci.plugins.workflow.multibranch.DurabilityHintBranchProperty plugin="workflow-multibranch"> + <hint>MAX_SURVIVABILITY</hint> + </org.jenkinsci.plugins.workflow.multibranch.DurabilityHintBranchProperty> + </a> + </properties> + </strategy> <buildStrategies> <jenkins.branch.buildstrategies.basic.TagBuildStrategyImpl plugin="basic-branch-build-strategies"> <atMostMillis>86400000</atMostMillis> diff --git a/tests/multibranch/fixtures/scm_gerrit_full.yaml b/tests/multibranch/fixtures/scm_gerrit_full.yaml index 15f8eb18..36040cb5 100644 --- a/tests/multibranch/fixtures/scm_gerrit_full.yaml +++ b/tests/multibranch/fixtures/scm_gerrit_full.yaml @@ -7,6 +7,10 @@ scm: credentials-id: secret ignore-on-push-notifications: true refspecs: 'refs/heads/*' + property-strategies: + all-branches: + - suppress-scm-triggering: true + - pipeline-branch-durability-override: max-survivability build-strategies: - tags: ignore-tags-newer-than: 1 diff --git a/tests/multibranch/fixtures/scm_git_full.xml b/tests/multibranch/fixtures/scm_git_full.xml index e5435217..837f0e55 100644 --- a/tests/multibranch/fixtures/scm_git_full.xml +++ b/tests/multibranch/fixtures/scm_git_full.xml @@ -81,6 +81,16 @@ </jenkins.plugins.git.traits.AuthorInChangelogTrait> </traits> </source> + <strategy class="jenkins.branch.DefaultBranchPropertyStrategy"> + <properties class="java.util.Arrays$ArrayList"> + <a class="jenkins.branch.BranchProperty-array"> + <jenkins.branch.NoTriggerBranchProperty/> + <org.jenkinsci.plugins.workflow.multibranch.DurabilityHintBranchProperty plugin="workflow-multibranch"> + <hint>MAX_SURVIVABILITY</hint> + </org.jenkinsci.plugins.workflow.multibranch.DurabilityHintBranchProperty> + </a> + </properties> + </strategy> <buildStrategies> <jenkins.branch.buildstrategies.basic.TagBuildStrategyImpl plugin="basic-branch-build-strategies"> <atMostMillis>86400000</atMostMillis> diff --git a/tests/multibranch/fixtures/scm_git_full.yaml b/tests/multibranch/fixtures/scm_git_full.yaml index 71a93278..5e2a28f5 100644 --- a/tests/multibranch/fixtures/scm_git_full.yaml +++ b/tests/multibranch/fixtures/scm_git_full.yaml @@ -9,6 +9,10 @@ scm: ignore-on-push-notifications: true discover-tags: true head-filter-regex: 'master|\d+\.\d+' + property-strategies: + all-branches: + - suppress-scm-triggering: true + - pipeline-branch-durability-override: max-survivability build-strategies: - tags: ignore-tags-newer-than: 1 diff --git a/tests/multibranch/fixtures/scm_github_full.xml b/tests/multibranch/fixtures/scm_github_full.xml index 769d066f..a74e2e6d 100644 --- a/tests/multibranch/fixtures/scm_github_full.xml +++ b/tests/multibranch/fixtures/scm_github_full.xml @@ -93,6 +93,16 @@ <com.adobe.jenkins.disable__github__multibranch__status.DisableStatusUpdateTrait plugin="disable-github-multibranch-status"/> </traits> </source> + <strategy class="jenkins.branch.DefaultBranchPropertyStrategy"> + <properties class="java.util.Arrays$ArrayList"> + <a class="jenkins.branch.BranchProperty-array"> + <jenkins.branch.NoTriggerBranchProperty/> + <org.jenkinsci.plugins.workflow.multibranch.DurabilityHintBranchProperty plugin="workflow-multibranch"> + <hint>MAX_SURVIVABILITY</hint> + </org.jenkinsci.plugins.workflow.multibranch.DurabilityHintBranchProperty> + </a> + </properties> + </strategy> <buildStrategies> <jenkins.branch.buildstrategies.basic.TagBuildStrategyImpl plugin="basic-branch-build-strategies"> <atMostMillis>86400000</atMostMillis> diff --git a/tests/multibranch/fixtures/scm_github_full.yaml b/tests/multibranch/fixtures/scm_github_full.yaml index 33a477c3..9b74e837 100644 --- a/tests/multibranch/fixtures/scm_github_full.yaml +++ b/tests/multibranch/fixtures/scm_github_full.yaml @@ -14,6 +14,10 @@ scm: discover-pr-forks-trust: everyone discover-pr-origin: both discover-tags: true + property-strategies: + all-branches: + - suppress-scm-triggering: true + - pipeline-branch-durability-override: max-survivability build-strategies: - tags: ignore-tags-newer-than: 1 |