Skip to content

Commit 93e398d

Browse files
committed
refactor: replace TerraformTasks with echo statements for testing
1 parent 1c57454 commit 93e398d

File tree

1 file changed

+46
-34
lines changed

1 file changed

+46
-34
lines changed

experiment-pipeline.yml

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -45,53 +45,65 @@ stages:
4545
inputs:
4646
terraformVersion: 1.3.1
4747
# 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
4950
displayName: Terraform init
5051
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
5758
# 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
6468
displayName: Select environment
6569
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
7276
# environmentServiceNameAzureRM: deployer
73-
- task: TerraformTaskV3@3
77+
targetType: inline
78+
script: echo $(workspace)
79+
# - task: TerraformTaskV3@3
80+
- task: Bash@3
7481
displayName: Terraform plan
7582
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
8390
# environmentServiceNameAzureRM: deployer
91+
targetType: inline
92+
script: echo "terraform plan"
8493
# the plan is done as part of the apply (below), so don't bother doing it twice
8594
condition: notIn(variables['Build.SourceBranchName'], 'dev', 'test', 'prod')
86-
- task: TerraformTaskV3@3
95+
# - task: TerraformTaskV3@3
96+
- task: Bash@3
8797
displayName: Terraform apply
8898
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
95105
# environmentServiceNameAzureRM: deployer
106+
targetType: inline
107+
script: echo "terraform apply"
96108
# only run on certain branches
97109
condition: in(variables['Build.SourceBranchName'], 'dev', 'test', 'prod')

0 commit comments

Comments
 (0)