Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add plan only switch #33

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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