Skip to content

Commit

Permalink
ci: fix tf plan and apply logic in Azure deploy step
Browse files Browse the repository at this point in the history
  • Loading branch information
lalver1 committed Jul 23, 2024
1 parent 0abc402 commit bbd4fc6
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions terraform/pipeline/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ steps:
environmentServiceNameAzureRM: "${{ parameters.service_connection }}"
# the plan is done as part of the apply (below), so don't bother doing it twice
condition: |
${{ and(
ne(variables['Build.SourceBranchName'], 'main'),
ne(parameters.tag_type, 'test'),
ne(parameters.tag_type, 'prod')
)
}}
and(
ne(variables['Build.SourceBranchName'], 'main'),
ne('${{ parameters.tag_type }}', 'test'),
ne('${{ parameters.tag_type }}', 'prod')
)
- task: TerraformTaskV3@3
displayName: Terraform apply
inputs:
Expand All @@ -69,9 +68,8 @@ steps:
environmentServiceNameAzureRM: "${{ parameters.service_connection }}"
# only run on main branch OR if it's a tag for test or prod
condition: |
${{ or(
eq(variables['Build.SourceBranchName'], 'main'),
eq(parameters.tag_type, 'test'),
eq(parameters.tag_type, 'prod')
)
}}
or(
eq(variables['Build.SourceBranchName'], 'main'),
eq('${{ parameters.tag_type }}', 'test'),
eq('${{ parameters.tag_type }}', 'prod')
)

0 comments on commit bbd4fc6

Please sign in to comment.