Skip to content

Commit b2c7d97

Browse files
committed
feat: use .terraform-version for azure-pipelines tf version
1 parent 13ca24b commit b2c7d97

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

base-infrastructure/azure-pipelines.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ jobs:
2323
displayName: "Checkout go-deploy"
2424
path: go-deploy
2525

26+
- task: PowerShell@2
27+
name: GetTerraformVersion
28+
inputs:
29+
targetType: 'inline'
30+
script: |
31+
$version = Get-Content .terraform-version | Select-Object -First 1
32+
Write-Host "Terraform version found: $version"
33+
# Set pipeline variable
34+
Write-Host "##vso[task.setvariable variable=terraformVersion]$version"
2635
- task: "TerraformInstaller@1"
2736
inputs:
28-
terraformVersion: '1.11.3'
37+
terraformVersion: '$(terraformVersion)'
2938

3039
# Deploy Terraform managed infrastructure to staging
3140
- script: chmod +x $(Pipeline.Workspace)/go-deploy/base-infrastructure/scripts/setup-infra.sh

0 commit comments

Comments
 (0)