Created
April 1, 2021 21:17
-
-
Save liliankasem/2f9209704401c512997d7e6c8a053399 to your computer and use it in GitHub Desktop.
Azure DevOps Variable Imports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| variables: | |
| - name: environment | |
| value: 'lilian' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment