@@ -45,53 +45,65 @@ stages:
45
45
inputs :
46
46
terraformVersion : 1.3.1
47
47
# https://github.com/microsoft/azure-pipelines-terraform/tree/main/Tasks/TerraformTask/TerraformTaskV3#readme
48
- - task : TerraformTaskV3@3
48
+ # - task: TerraformTaskV3@3
49
+ - task : Bash@3
49
50
displayName : Terraform init
50
51
inputs :
51
- provider : azurerm
52
- command : init
53
- workingDirectory : " $(System.DefaultWorkingDirectory)/terraform"
54
- # https://developer.hashicorp.com/terraform/tutorials/automation/automate-terraform#automated-terraform-cli-workflow
55
- commandOptions : -input=false
56
- # service connection
52
+ # provider: azurerm
53
+ # command: init
54
+ # workingDirectory: "$(System.DefaultWorkingDirectory)/terraform"
55
+ # # https://developer.hashicorp.com/terraform/tutorials/automation/automate-terraform#automated-terraform-cli-workflow
56
+ # commandOptions: -input=false
57
+ # # service connection
57
58
# backendServiceArm: deployer
58
- # needs to match main.tf
59
- backendAzureRmResourceGroupName : courtesy-cards-eligibility-terraform
60
- backendAzureRmStorageAccountName : courtesycardsterraform
61
- backendAzureRmContainerName : tfstate
62
- backendAzureRmKey : terraform.tfstate
63
- - task : TerraformTaskV3@3
59
+ # # needs to match main.tf
60
+ # backendAzureRmResourceGroupName: courtesy-cards-eligibility-terraform
61
+ # backendAzureRmStorageAccountName: courtesycardsterraform
62
+ # backendAzureRmContainerName: tfstate
63
+ # backendAzureRmKey: terraform.tfstate
64
+ targetType : inline
65
+ script : echo "terraform init"
66
+ # - task: TerraformTaskV3@3
67
+ - task : Bash@3
64
68
displayName : Select environment
65
69
inputs :
66
- provider : azurerm
67
- command : custom
68
- customCommand : workspace
69
- commandOptions : select $(workspace)
70
- workingDirectory : " $(System.DefaultWorkingDirectory)/terraform"
71
- # service connection
70
+ # provider: azurerm
71
+ # command: custom
72
+ # customCommand: workspace
73
+ # commandOptions: select $(workspace)
74
+ # workingDirectory: "$(System.DefaultWorkingDirectory)/terraform"
75
+ # # service connection
72
76
# environmentServiceNameAzureRM: deployer
73
- - task : TerraformTaskV3@3
77
+ targetType : inline
78
+ script : echo $(workspace)
79
+ # - task: TerraformTaskV3@3
80
+ - task : Bash@3
74
81
displayName : Terraform plan
75
82
inputs :
76
- provider : azurerm
77
- command : plan
78
- # wait for lock to be released, in case being used by another pipeline run
79
- # https://discuss.hashicorp.com/t/terraform-plan-wait-for-lock-to-be-released/6870/2
80
- commandOptions : -input=false -lock-timeout=5m
81
- workingDirectory : " $(System.DefaultWorkingDirectory)/terraform"
82
- # service connection
83
+ # provider: azurerm
84
+ # command: plan
85
+ # # wait for lock to be released, in case being used by another pipeline run
86
+ # # https://discuss.hashicorp.com/t/terraform-plan-wait-for-lock-to-be-released/6870/2
87
+ # commandOptions: -input=false -lock-timeout=5m
88
+ # workingDirectory: "$(System.DefaultWorkingDirectory)/terraform"
89
+ # # service connection
83
90
# environmentServiceNameAzureRM: deployer
91
+ targetType : inline
92
+ script : echo "terraform plan"
84
93
# the plan is done as part of the apply (below), so don't bother doing it twice
85
94
condition : notIn(variables['Build.SourceBranchName'], 'dev', 'test', 'prod')
86
- - task : TerraformTaskV3@3
95
+ # - task: TerraformTaskV3@3
96
+ - task : Bash@3
87
97
displayName : Terraform apply
88
98
inputs :
89
- provider : azurerm
90
- command : apply
91
- # (ditto the lock comment above)
92
- commandOptions : -input=false -lock-timeout=5m
93
- workingDirectory : " $(System.DefaultWorkingDirectory)/terraform"
94
- # service connection
99
+ # provider: azurerm
100
+ # command: apply
101
+ # # (ditto the lock comment above)
102
+ # commandOptions: -input=false -lock-timeout=5m
103
+ # workingDirectory: "$(System.DefaultWorkingDirectory)/terraform"
104
+ # # service connection
95
105
# environmentServiceNameAzureRM: deployer
106
+ targetType : inline
107
+ script : echo "terraform apply"
96
108
# only run on certain branches
97
109
condition : in(variables['Build.SourceBranchName'], 'dev', 'test', 'prod')
0 commit comments