0a2e4ed961
This patch enables parameters to be expanded inside of other parameters. For instance: - job-template: name: '{value-stream}_{pipeline_type}_foo' builders: - shell: 'echo "I am foo job!"' publishers: - trigger-parameterized-builds: - project: '{downstream}' current-parameters: False condition: ALWAYS git-revision: True - job-template: name: '{value-stream}_{pipeline_type}_bar' builders: - shell: 'echo "I am bar job!"' publishers: - trigger-parameterized-builds: - project: '{downstream}' current-parameters: False condition: ALWAYS git-revision: True - job-template: name: '{value-stream}_{pipeline_type}_baz' builders: - shell: 'echo "I am baz job!"' publishers: - trigger-parameterized-builds: - project: '{downstream}' current-parameters: False condition: ALWAYS git-revision: True - job-group: name: 'pipeline2' pipeline_type: 'p2' jobs: - '{value-stream}_{pipeline_type}_foo': downstream: '{value-stream}_{pipeline_type}_bar' - '{value-stream}_{pipeline_type}_bar': downstream: '{value-stream}_{pipeline_type}_baz' - '{value-stream}_{pipeline_type}_baz': - job-group: name: 'pipeline1' pipeline_type: 'p1' jobs: - '{value-stream}_{pipeline_type}_baz': downstream: '{value-stream}_{pipeline_type}_bar' - '{value-stream}_{pipeline_type}_bar': downstream: '{value-stream}_{pipeline_type}_foo' - '{value-stream}_{pipeline_type}_foo': - project: name: derp jobs: - 'pipeline1': value-stream: - experimental - staging - 'pipeline2': value-stream: - experimental - staging - production Prior to this commit, the setup above was not possible because the `downstream` defined as parameters to be passed to job templates in the job groups would not have the `value-stream` and `pipeline-type` parameters interpolated. The trigger-parameterized-jobs `project` value for each of the 15 jobs created with this setup would all look something like `{value-stream}_{pipeline_type}_foo` which does not actually point to any particular job. The only way I was previously able to specify a downstream job with parameters was to put the `{value-stream}_{pipeline_type}_foo` string directly in the job-template which meant that job templates were statically bound to each other--I had no reasonable way to re-order or easily select subsets of the jobs at the job-group or project level as can be seen here in the difference between `pipeline1` and `pipeline2`. Change-Id: I26dfb112cd4842c40c3d561f8de89f7654a07b8f
128 lines
4.8 KiB
XML
128 lines
4.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<project>
|
|
<actions/>
|
|
<description><!-- Managed by Jenkins Job Builder --></description>
|
|
<keepDependencies>false</keepDependencies>
|
|
<displayName>experimental p2 bar</displayName>
|
|
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
|
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
|
<concurrentBuild>false</concurrentBuild>
|
|
<canRoam>true</canRoam>
|
|
<properties/>
|
|
<scm class="hudson.scm.NullSCM"/>
|
|
<builders/>
|
|
<publishers>
|
|
<hudson.plugins.parameterizedtrigger.BuildTrigger>
|
|
<configs>
|
|
<hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
|
|
<configs>
|
|
<hudson.plugins.git.GitRevisionBuildParameters>
|
|
<combineQueuedCommits>false</combineQueuedCommits>
|
|
</hudson.plugins.git.GitRevisionBuildParameters>
|
|
</configs>
|
|
<projects/>
|
|
<condition>ALWAYS</condition>
|
|
<triggerWithNoParameters>false</triggerWithNoParameters>
|
|
</hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
|
|
</configs>
|
|
</hudson.plugins.parameterizedtrigger.BuildTrigger>
|
|
</publishers>
|
|
<buildWrappers/>
|
|
</project>
|
|
<BLANKLINE>
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
<project>
|
|
<actions/>
|
|
<description><!-- Managed by Jenkins Job Builder --></description>
|
|
<keepDependencies>false</keepDependencies>
|
|
<displayName>experimental p2 foo</displayName>
|
|
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
|
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
|
<concurrentBuild>false</concurrentBuild>
|
|
<canRoam>true</canRoam>
|
|
<properties/>
|
|
<scm class="hudson.scm.NullSCM"/>
|
|
<builders/>
|
|
<publishers>
|
|
<hudson.plugins.parameterizedtrigger.BuildTrigger>
|
|
<configs>
|
|
<hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
|
|
<configs>
|
|
<hudson.plugins.git.GitRevisionBuildParameters>
|
|
<combineQueuedCommits>false</combineQueuedCommits>
|
|
</hudson.plugins.git.GitRevisionBuildParameters>
|
|
</configs>
|
|
<projects>experimental_p2_bar</projects>
|
|
<condition>ALWAYS</condition>
|
|
<triggerWithNoParameters>false</triggerWithNoParameters>
|
|
</hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
|
|
</configs>
|
|
</hudson.plugins.parameterizedtrigger.BuildTrigger>
|
|
</publishers>
|
|
<buildWrappers/>
|
|
</project>
|
|
<BLANKLINE>
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
<project>
|
|
<actions/>
|
|
<description><!-- Managed by Jenkins Job Builder --></description>
|
|
<keepDependencies>false</keepDependencies>
|
|
<displayName>production p1 bar</displayName>
|
|
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
|
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
|
<concurrentBuild>false</concurrentBuild>
|
|
<canRoam>true</canRoam>
|
|
<properties/>
|
|
<scm class="hudson.scm.NullSCM"/>
|
|
<builders/>
|
|
<publishers>
|
|
<hudson.plugins.parameterizedtrigger.BuildTrigger>
|
|
<configs>
|
|
<hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
|
|
<configs>
|
|
<hudson.plugins.git.GitRevisionBuildParameters>
|
|
<combineQueuedCommits>false</combineQueuedCommits>
|
|
</hudson.plugins.git.GitRevisionBuildParameters>
|
|
</configs>
|
|
<projects>production_p1_foo</projects>
|
|
<condition>ALWAYS</condition>
|
|
<triggerWithNoParameters>false</triggerWithNoParameters>
|
|
</hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
|
|
</configs>
|
|
</hudson.plugins.parameterizedtrigger.BuildTrigger>
|
|
</publishers>
|
|
<buildWrappers/>
|
|
</project>
|
|
<BLANKLINE>
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
<project>
|
|
<actions/>
|
|
<description><!-- Managed by Jenkins Job Builder --></description>
|
|
<keepDependencies>false</keepDependencies>
|
|
<displayName>production p1 foo</displayName>
|
|
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
|
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
|
<concurrentBuild>false</concurrentBuild>
|
|
<canRoam>true</canRoam>
|
|
<properties/>
|
|
<scm class="hudson.scm.NullSCM"/>
|
|
<builders/>
|
|
<publishers>
|
|
<hudson.plugins.parameterizedtrigger.BuildTrigger>
|
|
<configs>
|
|
<hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
|
|
<configs>
|
|
<hudson.plugins.git.GitRevisionBuildParameters>
|
|
<combineQueuedCommits>false</combineQueuedCommits>
|
|
</hudson.plugins.git.GitRevisionBuildParameters>
|
|
</configs>
|
|
<projects/>
|
|
<condition>ALWAYS</condition>
|
|
<triggerWithNoParameters>false</triggerWithNoParameters>
|
|
</hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
|
|
</configs>
|
|
</hudson.plugins.parameterizedtrigger.BuildTrigger>
|
|
</publishers>
|
|
<buildWrappers/>
|
|
</project>
|