From 741ce73fa6ff6753a275ed205e804e11556548dc Mon Sep 17 00:00:00 2001 From: Anushka Bhandari Date: Sun, 20 May 2018 18:56:02 +0530 Subject: [PATCH] add pipeline template using nested stage command Change-Id: I52bbf54c5c1c2603473b36f362b42e9291976543 Story: #2001759 Task: #12157 --- jenkins_jobs/modules/project_pipeline.py | 5 +++++ .../fixtures/project_pipeline_template006.xml | 21 +++++++++++++++++++ .../project_pipeline_template006.yaml | 18 ++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 tests/yamlparser/fixtures/project_pipeline_template006.xml create mode 100644 tests/yamlparser/fixtures/project_pipeline_template006.yaml diff --git a/jenkins_jobs/modules/project_pipeline.py b/jenkins_jobs/modules/project_pipeline.py index 2b945cc0f..6b90860a1 100644 --- a/jenkins_jobs/modules/project_pipeline.py +++ b/jenkins_jobs/modules/project_pipeline.py @@ -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/ """ diff --git a/tests/yamlparser/fixtures/project_pipeline_template006.xml b/tests/yamlparser/fixtures/project_pipeline_template006.xml new file mode 100644 index 000000000..6fdc65224 --- /dev/null +++ b/tests/yamlparser/fixtures/project_pipeline_template006.xml @@ -0,0 +1,21 @@ + + + + + false + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + diff --git a/tests/yamlparser/fixtures/project_pipeline_template006.yaml b/tests/yamlparser/fixtures/project_pipeline_template006.yaml new file mode 100644 index 000000000..84d3b88b5 --- /dev/null +++ b/tests/yamlparser/fixtures/project_pipeline_template006.yaml @@ -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'