Categories
DevOps

How to check the HashiCorp software version

Use Checkpoint service to check the HashiCorp software version.

Current version check

Check the current Vagrant version.

$ curl --silent "https://checkpoint-api.hashicorp.com/v1/check/vagrant" | jq --raw-output ".current_version"
2.2.14

Check the current Terraform version.

$ curl --silent "https://checkpoint-api.hashicorp.com/v1/check/terraform" | jq --raw-output ".current_version"
0.14.0

Check the current Consul version.

$ curl --silent "https://checkpoint-api.hashicorp.com/v1/check/consul" | jq --raw-output ".current_version"
1.9.0

Check the current Packer version.

$ curl --silent "https://checkpoint-api.hashicorp.com/v1/check/packer" | jq --raw-output ".current_version"
1.6.5

Check the current Nomad version.

$ curl --silent "https://checkpoint-api.hashicorp.com/v1/check/nomad" | jq --raw-output ".current_version"
0.12.9

Upgrade check

Append additional parameters to perform an upgrade check.

Terraform 0.13.0 needs an upgrade.

$ curl -s "https://checkpoint-api.hashicorp.com/v1/check/terraform?arch=amd64&os=linux&version=0.13.0" | jq --exit-status 'if(.outdated?) then true else false end'
true
$ echo $?
0

Consul 1.9.0 does not need an upgrade.

$ curl -s "https://checkpoint-api.hashicorp.com/v1/check/consul?arch=amd64&os=linux&version=1.9.0" | jq --exit-status 'if(.outdated?) then true else false end'
false
$ echo $?
1

Details

Inspect generated JSON file to get additional information, like download or changelog URL.

$ curl -s "https://checkpoint-api.hashicorp.com/v1/check/terraform?arch=amd64&os=linux&version=0.14.0" | jq .
{
  "product": "terraform",
  "current_version": "0.14.0",
  "current_release": 1606948835,
  "current_download_url": "https://releases.hashicorp.com/terraform/0.14.0/",
  "current_changelog_url": "https://github.com/hashicorp/terraform/blob/v0.14.0/CHANGELOG.md",
  "project_website": "https://www.terraform.io",
  "alerts": []
}