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

30 lines
799 B
YAML
Raw Normal View History

parameters:
version:
type: string
default: 1.2.4
2020-05-04 23:02:15 +00:00
os:
type: string
default: linux
steps:
- run:
2020-05-04 23:02:15 +00:00
name: Install Vault
command: |
2020-05-04 23:02:15 +00:00
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