add pipeline template using nested stage command
Change-Id: I52bbf54c5c1c2603473b36f362b42e9291976543 Story: #2001759 Task: #12157
This commit is contained in:
parent
a77d29dcd5
commit
741ce73fa6
|
@ -66,6 +66,11 @@ Inline DSL job template example:
|
|||
.. literalinclude::
|
||||
/../../tests/yamlparser/fixtures/project_pipeline_template005.yaml
|
||||
|
||||
"Pipeline as nested stage" example :
|
||||
|
||||
.. literalinclude::
|
||||
/../../tests/yamlparser/fixtures/project_pipeline_template006.yaml
|
||||
|
||||
.. _Pipeline as code: https://jenkins.io/solutions/pipeline/
|
||||
|
||||
"""
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<flow-definition plugin="workflow-job">
|
||||
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps">
|
||||
<script>stage('Build another job') {
|
||||
build(job: "hello")
|
||||
}
|
||||
</script>
|
||||
<sandbox>false</sandbox>
|
||||
</definition>
|
||||
<actions/>
|
||||
<description><!-- Managed by Jenkins Job Builder --></description>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<canRoam>true</canRoam>
|
||||
<properties/>
|
||||
<scm class="hudson.scm.NullSCM"/>
|
||||
<publishers/>
|
||||
<buildWrappers/>
|
||||
</flow-definition>
|
|
@ -0,0 +1,18 @@
|
|||
- job-template:
|
||||
name: '{name}-unit-tests'
|
||||
project-type: pipeline
|
||||
dsl: |
|
||||
stage('Build another job') {{
|
||||
build(job: "{isay}")
|
||||
}}
|
||||
|
||||
- job-group:
|
||||
name: '{name}-tests'
|
||||
jobs:
|
||||
- '{name}-unit-tests':
|
||||
isay: 'hello'
|
||||
|
||||
- project:
|
||||
name: project-name
|
||||
jobs:
|
||||
- '{name}-tests'
|
Loading…
Reference in New Issue