Skip to content

Commit

Permalink
Feat/add plan only switch (#33)
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub Slon <[email protected]>
  • Loading branch information
Elephantei and Jakub Slon authored Oct 4, 2021
1 parent 1027d48 commit 326ac7c
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions azDevOps/azure/templates/v2/steps/deploy-terraform-meta-generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ parameters:
# Terraform Resource Specific Config
terraform_extra_properties: {}
terraform_output_commands: ''
terraform_plan_only: false

steps:
- template: ./deploy-terraform-init-generic.yml
Expand Down Expand Up @@ -45,18 +46,18 @@ steps:
# inputs:
# instructions: 'reject or resume'
# onTimeout: 'reject'

- bash: terraform apply tfplan
displayName: 'Terraform: Apply'
workingDirectory: ${{ parameters.working_dir }}
env:
# AUTH PARAMS
${{ each var in parameters.terraform_auth_properties }}:
${{ var.key }}: ${{ var.value }}
# Extra Parameters
# Business specific vars passed from pipeline
${{ each var in parameters.terraform_extra_properties }}:
${{ var.key }}: ${{ var.value }}
- ${{ if eq(parameters.terraform_plan_only, false) }}:
- bash: terraform apply tfplan
displayName: 'Terraform: Apply'
workingDirectory: ${{ parameters.working_dir }}
env:
# AUTH PARAMS
${{ each var in parameters.terraform_auth_properties }}:
${{ var.key }}: ${{ var.value }}
# Extra Parameters
# Business specific vars passed from pipeline
${{ each var in parameters.terraform_extra_properties }}:
${{ var.key }}: ${{ var.value }}

- bash: ${{ parameters.terraform_output_commands }}
displayName: 'Terraform: Write Outputs to Variables'
Expand Down

0 comments on commit 326ac7c

Please sign in to comment.