Created
April 26, 2017 20:56
-
-
Save andmos/b509a68526325c40fd1577337e14dd95 to your computer and use it in GitHub Desktop.
Install latest Terraform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
sudo apt-get install jq unzip | |
# Get URLs for most recent versions | |
terraform_url=$(curl --silent https://releases.hashicorp.com/index.json | jq '{terraform}' | egrep "linux.*64" | sort -rh | head -1 | awk -F[\"] '{print $4}') | |
# Create a move into directory. | |
cd | |
mkdir terraform && cd $_ | |
# Download Terraform. URI: https://www.terraform.io/downloads.html | |
curl -o terraform.zip $terraform_url | |
# Unzip and install | |
unzip terraform.zip | |
echo ' | |
# Terraform & Packer Paths. | |
export PATH=~/terraform/:$PATH | |
' >>~/.bash_profile | |
source ~/.bash_profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment