Skip to content

Instantly share code, notes, and snippets.

@pietergheysens
Created April 16, 2021 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pietergheysens/f83a36a6ecb2cca4df037b6b0be2584c to your computer and use it in GitHub Desktop.
Save pietergheysens/f83a36a6ecb2cca4df037b6b0be2584c to your computer and use it in GitHub Desktop.
Yaml pipeline with variable template
pool:
vmImage: ubuntu-latest
resources:
repositories:
- repository: sharedconfig
type: git
name: SharedConfiguration
variables:
- name: mainvar1
value: valuemainvar1
- template: pipeline-variables.yml@sharedconfig
stages:
- stage: DEV
jobs:
- job: A1
pool:
vmImage: ubuntu-latest
variables:
- template: configuration-dev.yml
- group: Secrets-DEV
steps:
- script: echo $(organisationUrl)
displayName: Output common variable
- script: echo $(var1)
displayName: Output variables DEV
- script: echo $(AdminUserPassword)
displayName: Output secure variables PRD
- stage: PRD
jobs:
- job: B1
pool:
vmImage: ubuntu-latest
variables:
- template: configuration-prd.yml
- group: Secrets-PRD
steps:
- script: echo $(organisationUrl)
displayName: Output common variable
- script: echo $(var1)
displayName: Output variables PRD
- script: echo $(AdminUserPassword)
displayName: Output secure variables PRD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment