diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2021-08-14 16:56:14 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2021-08-14 16:56:14 +0200 |
commit | 80c5076e76bbe93048e9f78e120c1ee9965f6728 (patch) | |
tree | 41db0296459c910a2d59663bd2ee9ed105a777b0 /bin/terraform | |
parent | e2b6e5847fd6579ff0f6801ec6c2b997d6d098f2 (diff) | |
download | infra-80c5076e76bbe93048e9f78e120c1ee9965f6728.tar.gz infra-80c5076e76bbe93048e9f78e120c1ee9965f6728.tar.bz2 infra-80c5076e76bbe93048e9f78e120c1ee9965f6728.tar.xz infra-80c5076e76bbe93048e9f78e120c1ee9965f6728.zip |
terraform
Diffstat (limited to 'bin/terraform')
-rwxr-xr-x | bin/terraform | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/bin/terraform b/bin/terraform index 06c2a76..249d7ae 100755 --- a/bin/terraform +++ b/bin/terraform @@ -1,25 +1,23 @@ #!/bin/bash set -euo pipefail -#set -x -basedir="$(dirname $0)" +basedir=$(dirname "$0") -terraform_version=0.13.5 -terraform_url=https://releases.hashicorp.com/terraform/$terraform_version/terraform_${terraform_version}_linux_amd64.zip +version=0.14.6 +version=0.13.5 +url=https://releases.hashicorp.com/terraform/${version}/terraform_${version}_linux_amd64.zip -dl_d=$basedir/.terraform/dl -zip_file=$dl_d/terraform-${terraform_version}.zip -unzip_d=$basedir/.terraform/unzip/$terraform_version -cmd=$unzip_d/terraform +bin="$basedir/.tmp/$version/terraform" -if [[ ! -x $cmd ]] +if [[ ! -x "$bin" ]] then - mkdir -p $dl_d - curl -L -o "$zip_file" $terraform_url - rm -rf $unzip_d - mkdir -p $unzip_d - unzip $zip_file -d $unzip_d + mkdir -p $(dirname "$bin") + wget -O "$bin.zip" "$url" + cd $(dirname "$bin") + unzip "$bin.zip" terraform + chmod +x terraform + cd - fi -exec "$cmd" "${@}" +exec "$bin" "${@}" |