jenkins-job-builder/tests/yamlparser/job_fixtures/job-and-macro-expansions.yaml
Vsevolod Fedorov 36b9d8bfca Add tags: '!include-raw-verbatim:' and '!include-raw-expand:'
Use '!include-raw-expand:' instead of '!include-raw:'
and '!include-raw-verbatim:' instead of '!include-raw-escape:'.
Tags '!include-raw:' and '!include-raw-escape:' are now deprecated.

Change-Id: I3cc5ab9f73d03de1ba09cbc4568366a3bb464a08
2024-02-07 14:22:54 +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-verbatim: 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-verbatim: job-and-macro-expansions.yaml.no-expand.inc
- shell: !include-raw-expand: 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-verbatim: 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-verbatim: job-and-macro-expansions.yaml.no-expand.inc
- shell: !include-raw-expand: job-and-macro-expansions.yaml.expand.inc
- project:
name: sample-project
param: sample param value
jobs:
- sample-job-template