Merge "Tests: Add test to demonstrate inter-parameter expansion"
This commit is contained in:
commit
a4052b1388
42
tests/yamlparser/job_fixtures/inter-parameter-expansion.xml
Normal file
42
tests/yamlparser/job_fixtures/inter-parameter-expansion.xml
Normal file
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<actions/>
|
||||
<description><!-- Managed by Jenkins Job Builder --></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 job_param_1=[{project_param_1} at-job-param-1]
|
||||
echo job_param_2=[{project_job_param_1} at-job-param-2]
|
||||
echo job_param_4=[{job_param_3} at-job-param-4]
|
||||
</command>
|
||||
</hudson.tasks.Shell>
|
||||
</builders>
|
||||
<publishers/>
|
||||
<buildWrappers/>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<actions/>
|
||||
<description><!-- Managed by Jenkins Job Builder --></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 job_param_1=[{group_param_1} at-job-param-1]
|
||||
</command>
|
||||
</hudson.tasks.Shell>
|
||||
</builders>
|
||||
<publishers/>
|
||||
<buildWrappers/>
|
||||
</project>
|
46
tests/yamlparser/job_fixtures/inter-parameter-expansion.yaml
Normal file
46
tests/yamlparser/job_fixtures/inter-parameter-expansion.yaml
Normal file
@ -0,0 +1,46 @@
|
||||
- job-template:
|
||||
name: sample-job-1
|
||||
# Does not substitute project_param_1 value:
|
||||
job_param_1: '{project_param_1} at-job-param-1'
|
||||
# Does not substitute project_job_param_1 value:
|
||||
job_param_2: '{project_job_param_1} at-job-param-2'
|
||||
job_param_3: job-param-3-value
|
||||
# Does not substitute job_param_3 value:
|
||||
job_param_4: '{job_param_3} at-job-param-4'
|
||||
builders:
|
||||
- shell: |
|
||||
echo job_param_1=[{job_param_1}]
|
||||
echo job_param_2=[{job_param_2}]
|
||||
echo job_param_4=[{job_param_4}]
|
||||
# - shell: |
|
||||
# echo project_param_2=[{project_param_2}]
|
||||
|
||||
|
||||
- job-template:
|
||||
name: sample-job-2
|
||||
# Does not substitute group_param_1 value:
|
||||
job_param_1: '{group_param_1} at-job-param-1'
|
||||
job_param_2: job-param-2-value
|
||||
builders:
|
||||
- shell: |
|
||||
echo job_param_1=[{job_param_1}]
|
||||
# - shell: |
|
||||
# echo group_param_2=[{group_param_2}]
|
||||
|
||||
- job-group:
|
||||
name: sample-job-group
|
||||
jobs:
|
||||
- sample-job-2:
|
||||
group_param_1: group-param-1-value
|
||||
# Group parameters can not access job parameters:
|
||||
# group_param_2: '{job_param_2} at-group-param-2'
|
||||
|
||||
- project:
|
||||
name: sample-project
|
||||
project_param_1: project-param-1-value
|
||||
# Project parameters can not access job parameters:
|
||||
# project_param_2: '{job_param_2} at-project-param-2'
|
||||
jobs:
|
||||
- sample-job-1:
|
||||
project_job_param_1: project-job-param-1
|
||||
- sample-job-group
|
Loading…
Reference in New Issue
Block a user