summaryrefslogtreecommitdiff
path: root/eng/common/templates/job/job.yml
diff options
context:
space:
mode:
Diffstat (limited to 'eng/common/templates/job/job.yml')
-rw-r--r--eng/common/templates/job/job.yml15
1 files changed, 15 insertions, 0 deletions
diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml
index 9fb858e487..5e293db35d 100644
--- a/eng/common/templates/job/job.yml
+++ b/eng/common/templates/job/job.yml
@@ -95,11 +95,26 @@ jobs:
variables:
- ${{ each variable in parameters.variables }}:
+ # handle name-value variable syntax
+ # example:
+ # - name: [key]
+ # value: [value]
- ${{ if ne(variable.name, '') }}:
- name: ${{ variable.name }}
value: ${{ variable.value }}
+
+ # handle variable groups
- ${{ if ne(variable.group, '') }}:
- group: ${{ variable.group }}
+
+ # handle key-value variable syntax.
+ # example:
+ # - [key]: [value]
+ - ${{ if and(eq(variable.name, ''), eq(variable.group, '')) }}:
+ - ${{ each pair in variable }}:
+ - name: ${{ pair.key }}
+ value: ${{ pair.value }}
+
# Add additional variables
- ${{ if and(ne(parameters.helixRepo, ''), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }}:
- name: _HelixSource