Skip to content

Instantly share code, notes, and snippets.

@liliankasem
Created April 1, 2021 21:17
Show Gist options
  • Select an option

  • Save liliankasem/2f9209704401c512997d7e6c8a053399 to your computer and use it in GitHub Desktop.

Select an option

Save liliankasem/2f9209704401c512997d7e6c8a053399 to your computer and use it in GitHub Desktop.
Azure DevOps Variable Imports
trigger: none
# Test 1: Import vars file at global level
# Pass: job environment set to 'lilian'
variables:
- template: vars.yml
stages:
- stage: Hello
displayName: 'Stage one'
# variables:
# Test 2: Import vars file at stage level
# Fail: job environment set to '$(environment)'
# - template: vars.yaml
jobs:
- deployment: deploy
displayName: Deploy Job
pool:
vmImage: ubuntu-20.04
# variables:
# Test 3: Import vars file at job level
# Fail: job environment set to '$(environment)'
# - template: vars.yaml
environment: $(environment)
strategy:
runOnce:
deploy:
steps:
- script: echo 'something'
displayName: 'Print something'
variables:
- name: environment
value: 'lilian'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment