diff --git a/src/@orb.yml b/src/@orb.yml index 2282945..ef19dc3 100755 --- a/src/@orb.yml +++ b/src/@orb.yml @@ -9,6 +9,5 @@ description: | display: source_url: https://github.com/smaeda-ks/orb-hashicorp-vault-cli -# If your orb requires other orbs, you can import them like this. Otherwise remove the "orbs" stanza. -# orbs: -# hello: circleci/hello-build@0.0.5 +orbs: + jq: circleci/jq@2.2.0 diff --git a/src/commands/install.yml b/src/commands/install.yml index 6c4834e..6bc493d 100755 --- a/src/commands/install.yml +++ b/src/commands/install.yml @@ -9,6 +9,7 @@ parameters: description: Directory in which to install vault type: string steps: + - jq/install - run: command: | # Quietly try to make the install directory. @@ -35,7 +36,7 @@ steps: if [ ! "$PARAM_VAULT_VERSION" = "latest" ]; then export VAULT_VER_STRING="$PARAM_VAULT_VERSION" else - PARAM_VAULT_VERSION=$(basename $(curl -fs -o /dev/null -w %{redirect_url} https://github.com/hashicorp/vault/releases/latest) | sed 's/v//') + PARAM_VAULT_VERSION=$(curl -fs https://api.releases.hashicorp.com/v1/releases/vault/latest | jq -r '.version') export VAULT_VER_STRING="$PARAM_VAULT_VERSION" fi