Is there a programmatic way to look up the latest version?

Is there a programmatic way to determine the latest version of the Vault (or really any of the HashiCorp products) binary? I have some scripts that I have written to download binaries, but I have to manually update the version to go get.

I would love to be able to use the new apt repo, but I am not able to find any arm64 support just yet. Similarly, I can probably just scrape the front pages, or the releases page, but I thought I’d check to see if there was an API or other recommended way to go about this.

You might be able to use the GitHub API to do this; see

The release is usually tagged in GH after we stage and release new binaries.

My team tells me that release engineering is working on a “latest” link at releases.hashicorp.com, or of course as you mention you could scrape the release page for Vault.

There was/ is the checkpoint page. It covers not all products - by design - but you can get the latest versions.

For example for consul:

https://checkpoint-api.hashicorp.com/v1/check/consul

2 Likes

Fantastic! Many thanks

Interesting that Vault is not in the list

There was a post by a developer… Let me see…

1 Like

Yeah, the main page states that Vault is intentionally not included. Curious as to why though.

I use this:

#!/bin/bash

for i in vault consul-template fabio
do
  if [[ ${i} == "fabio" ]]; then
    corp=fabiolb
  else
    corp=hashicorp
  fi
  ver=$(curl -fsS https://api.github.com/repos/${corp}/${i}/tags \
    | jq -re '.[].name' \
    | grep -v 'beta\|rc' \
    | sed 's/^v\(.*\)$/\1/g' \
    | sort -Vr \
    | head -1)
  echo -e "${ver}\t${i^}"
done

for i in terraform nomad consul
do
    ver=$(curl -Ss -X GET https://checkpoint-api.hashicorp.com/v1/check/${i}|jq -r .current_version)
    echo -e "${ver}\t${i^}"
done
1 Like

This is the work of heroes, right here. Thank you Billy!

1 Like