We have large application we deploy from ADO using classic pipelines. In the process of converting over to yaml. The application is made up of multiple smaller apps which are deployed individually into multiple environments. The environments are being added and removed as projects commence and complete so it is not a fixed list.
The problem is we will need to update 20-30 yamls each time the list changes.
We are using templates to reuse code extensively. The question is - can we have a master list of environments and parameters that can be read into each deployment at deploy time?
Here is a example snippet of the pipeline code we use - calls out to our deployment yaml for each environment/stage:
extends:
template: pipelines/main.yml@templates
deployStages:
- template: stages/deploy.yml@templates
parameters:
dependsOn: buildContainer
deploySteps:
- template: ./app-deploy.yml
parameters:
serviceConnection: test
environment: test
poolName: 'Azure Pipelines'
runIfNotMainOrMaster: ${{ eq(parameters.action, 'Deploy') }}
variableGroup: 'test'
- template: stages/deploy.yml@templates
parameters:
dependsOn: deploy_test
deploySteps:
- template: ./app-deploy.yml
parameters:
serviceConnection: staging
environment: stage
poolName: 'Azure Pipelines'
variableGroup: 'staging'
- template: stages/deploy.yml@templates
parameters:
dependsOn: deploy_stage
deploySteps:
- template: ./app-deploy.yml
parameters:
serviceConnection: production
environment: prd1
poolName: 'Azure Pipelines'
variableGroup: 'prd1'
etc.