sh install-hashicorp-devops-tools.sh

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh install-hashicorp-devops-tools.sh相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env bash

# THIS SHELL IS OUTDATED, PLEASE REFER TO https://gist.github.com/Adron/90863e51c8c5c0ad2049890bcd8abbfb FOR CURRENT INSTALLATION SCRIPT!

cd ~

devopsToolsRoot="DevopsTools"

# Terraform Path & Info
hashiTerraform="terraform_0_6_16"
hashiTerraformUri="https://releases.hashicorp.com/terraform/0.6.16/"
hashiTerraformFile="terraform_0.6.16_darwin_amd64.zip"

# Packer Path & Info
hashiPacker="packer_0_10_1"
hashiPackerUri="https://releases.hashicorp.com/packer/0.10.1/"
hashiPackerFile="packer_0.10.1_darwin_amd64.zip"

# Create root.
mkdir $devopsToolsRoot
cd $devopsToolsRoot

#----------------------Terraform Download & Unzip  ---------------------------#
# Create a move into directory.
mkdir $hashiTerraform
cd $hashiTerraform

# Download Terraform. URI: https://www.terraform.io/downloads.html
echo "Downloading and Unzipping $hashiTerraformUri$hashiTerraformFile."
curl -O "$hashiTerraformUri$hashiTerraformFile"

# Unzip, remove file, and source
unzip $hashiTerraformFile
rm -rf $hashiTerraformFile
#----------------------Packer Download & Unzip  ------------------------------#
cd ..

# Create and move into directory.
mkdir $hashiPacker
cd $hashiPacker

# Download Packer. URI: https://www.packer.io/downloads.html
echo "Downloading and Unzipping $hashiPackerUri$hashiPackerFile."
curl -O "$hashiPackerUri$hashiPackerFile"

# Unzip and install
unzip $hashiPackerFile
rm -rf $hashiPackerFile

echo '
# Terraform & Packer Paths.
export PATH=~/DevopsTools/packer_0_10_1:~/DevopsTools/terraform_0_6_16:$PATH
' >>~/.bash_profile

source ~/.bash_profile
terraform
packer

以上是关于sh install-hashicorp-devops-tools.sh的主要内容,如果未能解决你的问题,请参考以下文章

sh sh_template.sh

sh sh.sh

Linux下面如何运行 SH文件

配置告警系统主脚本main.sh mon.sh load.sh 502.sh disk.sh

shell 脚本各种执行方式(source ./*.sh, . ./*.sh, ./*.sh)的区别

linux下sh文件的运行