This is my first post here. I am a newbie in YAML and a beginners in Jenkins. I have a requirement where I have to create a multijob project
using Jenkins Job builders where project names
I want to store as a variable.
so the intention is explained below:
Job definition of Multijob Project:
job:
name: test_job
project-type: multijob
builders:
- multijob:
name: PhaseOne
condition: SUCCESSFUL
projects:
- name: PhaseOneJobA
current-parameters: true
git-revision: true
- name: PhaseOneJobB
current-parameters: true
property-file: build.props
I want to store following part in a List variable let's say : JobsList
- name: PhaseOneJobA
current-parameters: true
- name: PhaseOneJobB
current-parameters: true
as
jobsList:
- name: {list}
current-parameters: true
where list is
list:
-JobA
-JobB
so that I can use JobsList in my multijob definition. Something like this:
job:
name: test_job
project-type: multijob
builders:
- multijob:
name: PhaseOne
condition: SUCCESSFUL
projects: JobsList
and it expands into
job:
name: test_job
project-type: multijob
builders:
- multijob:
name: PhaseOne
condition: SUCCESSFUL
projects:
- name: JobA
current-parameters: true
- name: JobB
current-parameters: true
Any suggestion , how to do this?
-Archna