Merge "add pipeline template using nested stage command"

This commit is contained in:
Zuul 2018-06-21 17:42:12 +00:00 committed by Gerrit Code Review
commit 7611778a10
3 changed files with 44 additions and 0 deletions

View File

@ -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/
"""

View File

@ -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: &quot;hello&quot;)
}
</script>
<sandbox>false</sandbox>
</definition>
<actions/>
<description>&lt;!-- Managed by Jenkins Job Builder --&gt;</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>

View File

@ -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'