2017-09-08 03:12:52 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
|
2018-06-12 16:39:31 +00:00
|
|
|
VERSION=0.10.2
|
2017-10-21 23:08:22 +00:00
|
|
|
OS="linux"
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
|
|
|
OS="darwin"
|
|
|
|
fi
|
|
|
|
DOWNLOAD=https://releases.hashicorp.com/vault/${VERSION}/vault_${VERSION}_${OS}_amd64.zip
|
2017-09-08 03:12:52 +00:00
|
|
|
|
|
|
|
function install_vault() {
|
|
|
|
if [[ -e /usr/bin/vault ]] ; then
|
|
|
|
if [ "v${VERSION}" = "$(vault version | head -n1 | awk '{print $2}')" ] ; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
wget -q -O /tmp/vault.zip ${DOWNLOAD}
|
|
|
|
|
|
|
|
unzip -d /tmp /tmp/vault.zip
|
2017-10-19 19:10:56 +00:00
|
|
|
mv /tmp/vault /usr/local/bin/vault
|
|
|
|
chmod +x /usr/local/bin/vault
|
2017-09-08 03:12:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
install_vault
|