jenkins-job-builder/tests/yamlparser/job_fixtures/job-and-macro-expansions.yaml
Vsevolod Fedorov 18efe5066b Unify variable and tags expansion inside jobs and macros
Expand variables inside macros without parameters and jobs
the same way as they are expanded inside macros with parameters
and job templates.
Make tags behave inside macros without parameters and jobs
the same way as they are expanded inside macros with parameters
and job templates.
Update or fix affected tests.

Story: 2010588
Story: 2010963
Story: 2010535
Task: 47394
Task: 49069
Task: 47151

Change-Id: Ie05ae6aa386c62ebbf68dd3e2c7001a4e444a47a
2024-01-19 12:31:42 +03:00

52 lines
1.6 KiB
YAML

# Example for tickets:
# https://storyboard.openstack.org/#!/story/2010588 Expand macros even if called without arguments
# https://storyboard.openstack.org/#!/story/2010963 Expand jobs the same way as job templates are expanded
# Demonstrate different style of variable expansion and inclusion tags for
# macros with and without parameters and for jobs versus job templates.
- builder:
name: builder-without-params
builders:
- shell: |
echo Should not be expanded: {{param}}
- shell: !include-raw-escape: job-and-macro-expansions.yaml.no-expand.inc
- builder:
name: builder-with-params
builders:
- shell: |
echo Should not be expanded: {{param}}
- shell: |
echo Should be expanded: {param}
- shell: !include-raw-escape: job-and-macro-expansions.yaml.no-expand.inc
- shell: !include-raw: job-and-macro-expansions.yaml.expand.inc
- job:
name: sample-job
display-name: sample-job
builders:
- shell: |
echo Should not be expanded: {{param}}
- shell: !include-raw-escape: job-and-macro-expansions.yaml.no-expand.inc
- job-template:
name: sample-job-template
display-name: sample-job-template
builders:
- builder-without-params
- builder-with-params:
param: sample param value
- shell: |
echo Should not be expanded: {{param}}
- shell: |
echo Should be expanded: {param}
- shell: !include-raw-escape: job-and-macro-expansions.yaml.no-expand.inc
- shell: !include-raw: job-and-macro-expansions.yaml.expand.inc
- project:
name: sample-project
param: sample param value
jobs:
- sample-job-template