open-nomad/.circleci/config/commands/install-vault.yml
2020-05-15 10:15:37 -04:00

30 lines
799 B
YAML

parameters:
version:
type: string
default: 1.2.4
os:
type: string
default: linux
steps:
- run:
name: Install Vault
command: |
set -x
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"<< parameters.version >>"/vault_"<< parameters.version >>"_"<< parameters.os >>"_amd64.zip
if [[ << parameters.os >> == "linux" ]]
then
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
fi
if [[ << parameters.os >> == "windows" ]]
then
if [[ ! -f "c:\Windows\vault.exe" ]]
then
echo "Cache not found, doing a fresh install of vault"
unzip /tmp/vault.zip -d "/c/Windows"
rm -rf /tmp/vault*
fi
fi