Fix "abort-builds" for WorkflowMultiBranchProject
"abort-builds" must be present in job_contents_keys in order for it to properly work. Also add a multibranch test for the yamlparser that will verify that this works properly. Change-Id: Ide9cd0f89a19002977cdcc2dfb9cd873e7d16945
This commit is contained in:
parent
7bf0dacd80
commit
50dd589966
@ -79,6 +79,7 @@ job_contents_keys = {
|
||||
"prune-dead-branches",
|
||||
"days-to-keep",
|
||||
"number-to-keep",
|
||||
"abort-builds",
|
||||
"periodic-folder-trigger",
|
||||
# Pipeline.
|
||||
"dsl",
|
||||
|
54
tests/yamlparser/job_fixtures/multi_scm_full.xml
Normal file
54
tests/yamlparser/job_fixtures/multi_scm_full.xml
Normal file
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject plugin="workflow-multibranch">
|
||||
<properties/>
|
||||
<views>
|
||||
<hudson.model.AllView>
|
||||
<name>All</name>
|
||||
<filterExecutors>false</filterExecutors>
|
||||
<filterQueue>false</filterQueue>
|
||||
<properties class="hudson.model.View$PropertyList"/>
|
||||
<owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../../.."/>
|
||||
</hudson.model.AllView>
|
||||
</views>
|
||||
<viewsTabBar class="hudson.views.DefaultViewsTabBar"/>
|
||||
<folderViews class="jenkins.branch.MultiBranchProjectViewHolder" plugin="branch-api">
|
||||
<owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
|
||||
</folderViews>
|
||||
<healthMetrics>
|
||||
<com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric plugin="cloudbees-folder">
|
||||
<nonRecursive>false</nonRecursive>
|
||||
</com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric>
|
||||
</healthMetrics>
|
||||
<icon class="jenkins.branch.MetadataActionFolderIcon" plugin="branch-api">
|
||||
<owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
|
||||
</icon>
|
||||
<orphanedItemStrategy class="com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" plugin="cloudbees-folder">
|
||||
<pruneDeadBranches>true</pruneDeadBranches>
|
||||
<daysToKeep>10</daysToKeep>
|
||||
<numToKeep>10</numToKeep>
|
||||
<abortBuilds>true</abortBuilds>
|
||||
</orphanedItemStrategy>
|
||||
<triggers>
|
||||
<com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger plugin="cloudbees-folder">
|
||||
<spec>H H * * *</spec>
|
||||
<interval>86400000</interval>
|
||||
</com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger>
|
||||
</triggers>
|
||||
<sources class="jenkins.branch.MultiBranchProject$BranchSourceList" plugin="branch-api">
|
||||
<data/>
|
||||
<owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
|
||||
</sources>
|
||||
<factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory">
|
||||
<owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
|
||||
<scriptPath>some.Jenkinsfile</scriptPath>
|
||||
</factory>
|
||||
<actions/>
|
||||
<description>Workflow demo<!-- Managed by Jenkins Job Builder --></description>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<canRoam>true</canRoam>
|
||||
<publishers/>
|
||||
<buildWrappers/>
|
||||
</org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject>
|
13
tests/yamlparser/job_fixtures/multi_scm_full.yaml
Normal file
13
tests/yamlparser/job_fixtures/multi_scm_full.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
- job:
|
||||
name: 'demo-multibranch-multi-scm-full'
|
||||
description: 'Workflow demo'
|
||||
|
||||
project-type: multibranch
|
||||
|
||||
periodic-folder-trigger: 1d
|
||||
prune-dead-branches: True
|
||||
number-to-keep: '10'
|
||||
days-to-keep: '10'
|
||||
abort-builds: True
|
||||
script-path: 'some.Jenkinsfile'
|
||||
scm: []
|
Loading…
Reference in New Issue
Block a user