forked from MicrosoftDocs/mslearn-tailspin-spacegame-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-deploy-prod.yml
37 lines (33 loc) · 1.1 KB
/
azure-pipelines-deploy-prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Sample of multi-stage CD pipeline using YAML template and Terraform plugin for deployment to preprod and prod
resources:
pipelines:
- pipeline: 'build'
source: 'azure-pipelines'
trigger:
branches:
- master
variables:
appName: 'SpaceGameWeb'
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: 'tfplanpreprod'
displayName: Plan terraform for preprod environment
condition: eq(resource.pipeline.build.SourceBranch, 'refs/heads/master')
jobs:
- template: ./azure-pipelines-deploy-plan-template.yml
parameters:
job_name: tf_plan_to_preprod
display_name: Terraform plan $(appName) to preprod environment
build_branch: 'master'
variable_group_name: preprod_configuration
- stage: 'tfapplypreprod'
displayName: Apply terraform to preprod
dependsOn: tfplanpreprod
jobs:
- template: ./azure-pipelines-deploy-apply-template.yml
parameters:
job_name: apply_to_preprod
display_name: Terraform apply $(appName) to preprod environment
build_branch: 'master'
variable_group_name: preprod_configuration