jenkins-job-builder/tests/yamlparser/job_fixtures/job-and-macro-expansions.yaml

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: 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: 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