This file contains 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 | |
pool: | |
vmImage: 'ubuntu-latest' | |
stages: | |
- stage: DevPlan | |
displayName: Dev Plan | |
jobs: | |
- job: |
This file contains 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
steps: | |
- task: Cache@2 | |
displayName: 'Register TF cache' | |
inputs: | |
key: terraform | $(Agent.OS) | "$(Build.BuildNumber)" | $(Build.SourceVersion) | $(tfComponent) | "$(tfVarFileName)" | |
path: $(tfExecutionDir) | |
- task: TerraformInstaller@0 | |
displayName: 'Install Terraform' | |
inputs: | |
terraformVersion: '$(terraformVersion)' |
This file contains 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: PROJECT_PATH | |
value: terraform | |
- name: tfComponent | |
value: cluster | |
- name: tfExecutionDir | |
value: '$(PROJECT_PATH)/src/$(tfComponent)' | |
- name: terraformVersion | |
value: 0.12.21 | |
- name: serviceConnectionName |
This file contains 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 | |
pool: | |
vmImage: 'ubuntu-latest' | |
stages: | |
- stage: | |
displayName: 'Terraform Plan' | |
jobs: | |
- job: TFPlan |
This file contains 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
--- | |
parameters: | |
- name: serviceConnectionName | |
type: string | |
- name: backendAzureRmResourceGroupName | |
type: string | |
- name: backendAzureRmStorageAccountName | |
type: string | |
- name: backendAzureRmContainerName | |
type: string |
This file contains 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
--- | |
... | |
stages: | |
- stage: | |
displayName: 'Terraform Plan' | |
jobs: | |
- job: TFPlan | |
variables: # <--Variables are now scoped to this job and all steps within it | |
- template: vars/dev_vars.yml | |
steps: |
This file contains 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: terraformVersion | |
value: 0.12.23 | |
trigger: none | |
pool: | |
vmImage: 'ubuntu-latest' | |
stages: | |
- stage: |
This file contains 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
parameters: | |
- name: tfVarFileName | |
type: string | |
default: '' # foo.tfvars, for example | |
stages: | |
- stage: | |
displayName: 'Terraform Apply' | |
jobs: | |
- deployment: Deploy |
This file contains 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
parameters: | |
- name: serviceConnectionName | |
type: string | |
- name: backendAzureRmResourceGroupName | |
type: string | |
- name: backendAzureRmStorageAccountName | |
type: string | |
- name: backendAzureRmContainerName | |
type: string | |
- name: backendAzureRmKey |
This file contains 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
--- | |
- task: Cache@2 | |
displayName: 'Get Cache for TF Artifact' | |
inputs: | |
key: terraform | $(Agent.OS) | "$(Build.BuildNumber)" | $(Build.SourceVersion) | $(tfComponent) | "$(tfVarFileName)" | |
path: $(tfExecutionDir) | |
- task: TerraformInstaller@0 | |
displayName: 'Install Terraform' | |
inputs: | |
terraformVersion: '$(terraformVersion)' |