Skip to content

Commit

Permalink
refactor: try environment approval check instead for more options
Browse files Browse the repository at this point in the history
approval check lets you configure more parameters around approvers
  • Loading branch information
angela-tran committed Aug 24, 2023
1 parent 14f49b5 commit d264f57
Showing 1 changed file with 23 additions and 28 deletions.
51 changes: 23 additions & 28 deletions experiment-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ stages:
pool:
vmImage: ubuntu-latest
jobs:
- job: "Plan"
- job: Plan
variables:
- name: OTHER_SOURCE
value: $[variables['System.PullRequest.SourceBranch']]
Expand Down Expand Up @@ -91,30 +91,25 @@ stages:
script: echo "terraform plan"
# the plan is done as part of the apply (below), so don't bother doing it twice
condition: notIn(variables['Build.SourceBranchName'], 'dev', 'test', 'prod')
- job: "ManualApproval"
pool: server
steps:
# - task: TerraformTaskV3@
- task: ManualValidation@0
timeoutInMinutes: "1440" # task times out in 1 day
inputs:
notifyUsers: |
[email protected]
instructions: "Please review the output of Terraform plan before approving."
onTimeout: "reject"
- job: "Apply"
steps:
- task: Bash@3
displayName: Terraform apply
inputs:
# provider: azurerm
# command: apply
# # (ditto the lock comment above)
# commandOptions: -input=false -lock-timeout=5m
# workingDirectory: "$(System.DefaultWorkingDirectory)/terraform"
# # service connection
# environmentServiceNameAzureRM: deployer
targetType: inline
script: echo "terraform apply"
# only run on certain branches
condition: in(variables['Build.SourceBranchName'], 'dev', 'test', 'prod')
- deployment: Apply
dependsOn: Plan
condition: succeeded()
environment: Approval
strategy:
runOnce:
deploy:
steps:
- task: Bash@3
displayName: Terraform apply
inputs:
# provider: azurerm
# command: apply
# # (ditto the lock comment above)
# commandOptions: -input=false -lock-timeout=5m
# workingDirectory: "$(System.DefaultWorkingDirectory)/terraform"
# # service connection
# environmentServiceNameAzureRM: deployer
targetType: inline
script: echo "terraform apply"
# only run on certain branches
condition: in(variables['Build.SourceBranchName'], 'dev', 'test', 'prod')

0 comments on commit d264f57

Please sign in to comment.