open-nomad/.circleci/config/commands/install-vault.yml

28 lines
760 B
YAML
Raw Normal View History

parameters:
version:
type: string
default: 1.2.4
steps:
- run:
2020-05-04 23:02:15 +00:00
name: Install Vault
command: |
2020-05-04 23:02:15 +00:00
set -x
case "${OSTYPE}" in
linux*) os="linux" ;;
darwin*) os="darwin" ;;
msys*) os="windows" ;;
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
esac
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"<< parameters.version >>"/vault_"<< parameters.version >>"_"${os}"_amd64.zip
2020-05-04 23:02:15 +00:00
if [[ "${os}" != "windows" ]]; then
2020-05-04 23:02:15 +00:00
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
else
rm -rf c:\Windows\vault.exe
unzip /tmp/vault.zip -d "/c/Windows"
rm -rf /tmp/vault*
2020-05-04 23:02:15 +00:00
fi