Riku Voipio | cc7f42f | 2021-02-17 15:00:32 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -eu |
| 4 | TOP=$(dirname $0) |
| 5 | |
| 6 | update_terraform() |
| 7 | { |
Riku Voipio | e617838 | 2021-04-29 16:15:14 +0300 | [diff] [blame] | 8 | export TFVERS=0.12.31 |
Riku Voipio | cc7f42f | 2021-02-17 15:00:32 +0200 | [diff] [blame] | 9 | if [ ! -x $TOP/.bin/terraform_${TFVERS} ] |
| 10 | then |
| 11 | ( |
| 12 | mkdir -p $TOP/.bin/ |
| 13 | cd $TOP/.bin |
| 14 | wget -q https://releases.hashicorp.com/terraform/${TFVERS}/terraform_${TFVERS}_linux_amd64.zip |
| 15 | unzip -o terraform_${TFVERS}_linux_amd64.zip |
| 16 | mv terraform terraform_${TFVERS} |
| 17 | chmod a+x terraform_${TFVERS} |
| 18 | ln -sf terraform_${TFVERS} terraform |
| 19 | rm terraform_${TFVERS}_linux_amd64.zip |
| 20 | ) |
| 21 | fi |
| 22 | } |
| 23 | |
| 24 | update_terraform |
| 25 | |
| 26 | $TOP/.bin/terraform "$@" |
| 27 | |