-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathinstall-terraform.sh
executable file
·30 lines (25 loc) · 1 KB
/
install-terraform.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# installs 'tfenv', a Terraform version manager: https://github.com/tfutils/tfenv
# this allows us to migrate projects between versions of Terraform.
set -e
if [ ! -d .tfenv ]; then
wget https://github.com/tfutils/tfenv/archive/refs/tags/v3.0.0.tar.gz \
--output-document=tfenv.tar.gz \
--quiet
sha256sum --check tfenv.sha256
tar -xzf tfenv.tar.gz
mv tfenv-3.0.0 .tfenv
rm tfenv.tar.gz
fi
.tfenv/bin/tfenv uninstall 0.11.15 || true
.tfenv/bin/tfenv uninstall 0.13.7 || true
.tfenv/bin/tfenv uninstall 0.14.11 || true
.tfenv/bin/tfenv uninstall 0.15.5 || true
.tfenv/bin/tfenv uninstall 1.0.11 || true
# see: https://releases.hashicorp.com/terraform/
# note: values should match `projects/elife.yaml` under 'defaults.terraform.version'.
.tfenv/bin/tfenv install 1.1.9
# activate the default version.
# "this is used when not overridden by '.terraform-version' or 'TFENV_TERRAFORM_VERSION'"
# - https://github.com/tfutils/tfenv#tfenv-install-version
.tfenv/bin/tfenv use 1.1.9