Skip to content

Commit 0079196

Browse files
authored
Use HashiCorp Releases API to get latest version (#8)
* Use HashiCorp Releases API to get latest version * move `orbs` stanza to top-level
1 parent 6599b48 commit 0079196

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/@orb.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ description: |
99
display:
1010
source_url: https://github.com/smaeda-ks/orb-hashicorp-vault-cli
1111

12-
# If your orb requires other orbs, you can import them like this. Otherwise remove the "orbs" stanza.
13-
# orbs:
14-
# hello: circleci/[email protected]
12+
orbs:
13+
jq: circleci/[email protected]

src/commands/install.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ parameters:
99
description: Directory in which to install vault
1010
type: string
1111
steps:
12+
- jq/install
1213
- run:
1314
command: |
1415
# Quietly try to make the install directory.
@@ -35,7 +36,7 @@ steps:
3536
if [ ! "$PARAM_VAULT_VERSION" = "latest" ]; then
3637
export VAULT_VER_STRING="$PARAM_VAULT_VERSION"
3738
else
38-
PARAM_VAULT_VERSION=$(basename $(curl -fs -o /dev/null -w %{redirect_url} https://github.com/hashicorp/vault/releases/latest) | sed 's/v//')
39+
PARAM_VAULT_VERSION=$(curl -fs https://api.releases.hashicorp.com/v1/releases/vault/latest | jq -r '.version')
3940
export VAULT_VER_STRING="$PARAM_VAULT_VERSION"
4041
fi
4142

0 commit comments

Comments
 (0)