File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -10,22 +10,20 @@ echo ""
10
10
apk info
11
11
12
12
# export TERRAFORM_VERSIONS=$(cat build.config.yaml | shyaml get-values terraform.versions)
13
- TERRAFORM_VERSION=1.2.2
13
+ LATEST_RELEASE=$( curl https://api.github.com/repos/hashicorp/terraform/releases/latest | jq --raw-output ' .tag_name' | cut -c 2-)
14
+ TERRAFORM_VERSION=${LATEST_RELEASE}
14
15
echo " USING TERRAFORM VERSION: [$TERRAFORM_VERSION ]"
15
16
16
-
17
17
mkdir -p /opt/download
18
18
cd /opt/download
19
19
20
20
echo " CD - DOWNLOAD FOLDER"
21
21
22
- if command -v terraform & > /dev/null
23
- then
24
- # Terraform already installed
22
+ # Terraform already installed
23
+ if command -v terraform & > /dev/null; then
25
24
exit
26
25
fi
27
26
28
-
29
27
echo " INSTALLING TERRAFORM"
30
28
31
29
TERRAFORM_DOWNLOAD_URL=" https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION} /terraform_${TERRAFORM_VERSION} _linux_amd64.zip"
@@ -35,4 +33,5 @@ mv terraform /usr/local/bin/terraform-${TERRAFORM_VERSION}
35
33
ln -s /usr/local/bin/terraform-${TERRAFORM_VERSION} /usr/local/bin/terraform
36
34
chmod +x /usr/local/bin/terraform-${TERRAFORM_VERSION}
37
35
38
-
36
+ # Verify the Terraform installation
37
+ terraform version
You can’t perform that action at this time.
0 commit comments