Skip to content

Instantly share code, notes, and snippets.

@rudolphjacksonm
Created June 8, 2020 20:12
Show Gist options
  • Save rudolphjacksonm/6be5c25d29e1b971b98c86a3889f824a to your computer and use it in GitHub Desktop.
Save rudolphjacksonm/6be5c25d29e1b971b98c86a3889f824a to your computer and use it in GitHub Desktop.
trigger:
- none
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: DevPlan
displayName: Dev Plan
jobs:
- job:
displayName: Terraform Plan - Dev Environment
variables:
- template: vars/dev_vars.yml
steps:
- template: templates/terraform_plan.yml
parameters:
serviceConnectionName: terraform-sp
backendAzureRmResourceGroupName: $(rgName)
backendAzureRmStorageAccountName: $(storageAccountName)
backendAzureRmContainerName: $(backendAzureRmContainerName)
backendAzureRmKey: $(tfState)
tfComponent: $(tfComponent)
tfExecutionDir: $(tfExecutionDir)
tfVarFileName: $(tfVarFileName)
- stage: DevApply
displayName: Dev Apply
jobs:
- deployment: Deploy
displayName: Terraform Apply - Dev Environment
pool:
vmImage: 'ubuntu-latest'
environment: dev
variables:
- template: vars/dev_vars.yml
strategy:
runOnce:
deploy:
steps:
- template: templates/terraform_apply.yml
parameters:
serviceConnectionName: terraform-sp
backendAzureRmResourceGroupName: $(rgName)
backendAzureRmStorageAccountName: $(storageAccountName)
backendAzureRmContainerName: $(backendAzureRmContainerName)
backendAzureRmKey: $(tfState)
tfComponent: $(tfComponent)
tfExecutionDir: $(tfExecutionDir)
tfVarFileName: $(tfVarFileName)
- stage: StagingPlan
displayName: Staging Plan
jobs:
- job:
displayName: Terraform Plan - Staging Environment
variables:
- template: vars/staging_vars.yml
steps:
- template: templates/terraform_plan.yml
parameters:
serviceConnectionName: terraform-sp
backendAzureRmResourceGroupName: $(rgName)
backendAzureRmStorageAccountName: $(storageAccountName)
backendAzureRmContainerName: $(backendAzureRmContainerName)
backendAzureRmKey: $(tfState)
tfComponent: $(tfComponent)
tfExecutionDir: $(tfExecutionDir)
tfVarFileName: $(tfVarFileName)
- stage: StagingApply
displayName: Staging Apply
jobs:
- deployment: Deploy
displayName: Terraform Apply - Staging Environment
pool:
vmImage: 'ubuntu-latest'
environment: staging
variables:
- template: vars/staging_vars.yml
strategy:
runOnce:
deploy:
steps:
- template: templates/terraform_apply.yml
parameters:
serviceConnectionName: terraform-sp
backendAzureRmResourceGroupName: $(rgName)
backendAzureRmStorageAccountName: $(storageAccountName)
backendAzureRmContainerName: $(backendAzureRmContainerName)
backendAzureRmKey: $(tfState)
tfComponent: $(tfComponent)
tfExecutionDir: $(tfExecutionDir)
tfVarFileName: $(tfVarFileName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment