Tests: Add test for dimension parameter used in template name

Change-Id: Ib37291de1d30fe694bb6e301f56428627bbc7eb5
This commit is contained in:
Vsevolod Fedorov 2023-02-13 12:55:33 +03:00
parent 8784d916a6
commit fa1ac99ff0
2 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<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"/>
<builders>
<hudson.tasks.Shell>
<command>echo param_1_value param_key
</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project>
<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"/>
<builders>
<hudson.tasks.Shell>
<command>echo param_key param_2_value
</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>

View File

@ -0,0 +1,23 @@
# Parameter defined under dimension can be used in template name.
- job-template:
name: job-{param_1}-{param_2}
builders:
- shell: |
echo {param_1} {param_2}
- project:
name: sample-project-1
param_1:
- param_key:
param_2: param_2_value
jobs:
- job-{param_1}-{param_2}
- project:
name: sample-project-2
param_2:
- param_key:
param_1: param_1_value
jobs:
- job-{param_1}-{param_2}