File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,28 @@ jobs:
3030 - name : Install Terraform
3131 run : |
3232 set -eu
33- curl -s -L "https://releases.hashicorp.com/terraform/1.3.6/terraform_1.3.6_linux_amd64.zip" > "terraform-bin.zip "
33+ terraform_version="1.6.6 "
3434
35- # overwrite existing Terraform binary
35+ set +e
3636 terraform_bin="$(which terraform)"
37+ set -e
38+ if [ -z "$terraform_bin" ]
39+ then
40+ terraform_bin="/usr/local/bin/terraform"
41+ echo "Installing Terraform ($terraform_bin)"
42+ else
43+ echo "Replacing Terraform ($terraform_bin)"
44+ fi
45+ echo "Downloading version $terraform_version"
46+ curl -s -L "https://releases.hashicorp.com/terraform/${terraform_version}/terraform_${terraform_version}_linux_amd64.zip" > "terraform-bin.zip"
47+ echo "Unzipping archive"
3748 unzip -p terraform-bin.zip > terraform-bin
49+ echo "Moving into place"
3850 sudo mv terraform-bin "$terraform_bin"
51+ echo "Making executable"
3952 sudo chmod +x "$terraform_bin"
53+ echo "Cleaning-up"
4054 rm terraform-bin.zip
41-
4255 echo "Installed: $(eval "$terraform_bin version") ($terraform_bin)"
4356
4457 - name : Run make fmt
You can’t perform that action at this time.
0 commit comments