-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: try environment approval check instead for more options
approval check lets you configure more parameters around approvers
- Loading branch information
1 parent
14f49b5
commit d264f57
Showing
1 changed file
with
23 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ stages: | |
pool: | ||
vmImage: ubuntu-latest | ||
jobs: | ||
- job: "Plan" | ||
- job: Plan | ||
variables: | ||
- name: OTHER_SOURCE | ||
value: $[variables['System.PullRequest.SourceBranch']] | ||
|
@@ -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') |