New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get latest HashiCorp releases #696
base: master
Are you sure you want to change the base?
Conversation
This PR resolves #687 and future bumps of Hashicorp tools (except for Waypoint that isn't yet available on https://checkpoint-api.hashicorp.com/ ) |
log.Printf("Found: %s", v) | ||
} | ||
version = v | ||
} else if strings.Contains(tool.URLTemplate, "https://releases.hashicorp.com") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could work, but I wonder if there's a cleaner way to express it? For instance, when we also may want to download the latest version of kubectl, which has a text file showing the latest version in text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @alexellis , I raised several implementation suggestions on #560 but I didn't get a response regarding an overall solution. Please let me know if you'd like me to resolve that.
Instead, on this PR I'm only suggesting to resolve HashiCorp versions that has a unique pattern which doesn't require refactoring.
d49a095
to
0104fa3
Compare
fyi: there is a new releases api available: https://api.releases.hashicorp.com/ |
0104fa3
to
408a6bf
Compare
@jsiebens Thanks! I updated the PR. Now with support for usage example regular (hardcoded version ➜ arkade git:(get-latest-hashicorp-releases) ✗ arkade get --stash=false vagrant
Downloading: vagrant
Downloading: https://releases.hashicorp.com/vagrant/2.2.19/vagrant_2.2.19_linux_amd64.zip
14.37 MiB / 14.37 MiB [--------------------------------------------------------------------------------------------------------] 100.00%
/tmp/vagrant_2.2.19_linux_amd64.zip written.
Name: vagrant_2.2.19_linux_amd64.zip, size: 150642482022/09/11 15:50:42 Extracted: /tmp/vagrant
... new code (takes latest release ➜ arkade git:(get-latest-hashicorp-releases) ✗ ./bin/arkade get --stash=false vagrant
Downloading: vagrant
2022/09/11 15:50:30 Looking up version for vagrant on HashiCorp
2022/09/11 15:50:31 Found: 2.3.0
Downloading: https://releases.hashicorp.com/vagrant/2.3.0/vagrant_2.3.0_linux_amd64.zip
36.29 MiB / 36.29 MiB [--------------------------------------------------------------------------------------------------------] 100.00%
/tmp/vagrant_2.3.0_linux_amd64.zip written.
2022/09/11 15:50:38 Looking up version for vagrant on HashiCorp
2022/09/11 15:50:38 Found: 2.3.0
Name: vagrant_2.3.0_linux_amd64.zip, size: 380500642022/09/11 15:50:38 Extracted: /tmp/vagrant
... |
Related to alexellis#560 In case a tool has a `URLTemplate` including https://releases.hashicorp.com , it will fetch its latest release via the https://api.releases.hashicorp.com/v1/releases API querying for artifact with an "oss" license class. At the moment, `terraform`, `vagrant`, `vault`, `waypoint`, and `packer` are being supported. Signed-off-by: Yuval Goldberg <yuvigoldi@gmail.com>
408a6bf
to
76908d3
Compare
WDYT? @alexellis @Shikachuu Currently, all of arkade's HashiCorp tools are outdated. ➜ ~ tools=(terraform vagrant vault waypoint packer); for tool in ${tools[@]}; do echo "${tool} - current_arkade: $(arkade get --stash=false "${tool}" 2&>1 | grep "/${tool}_" | cut -d_ -f2 | sort -u) new_arkade: $(./bin/arkade get --stash=false "${tool}" 2&>1 | grep "/${tool}_" | cut -d_ -f2 | sort -u) latest: $(curl -s "https://api.releases.hashicorp.com/v1/releases/${tool}?license_class=oss" | jq -r '.[0].version')"; done
terraform - current_arkade: 1.1.9 new_arkade: 1.3.0 latest: 1.3.0
vagrant - current_arkade: 2.2.19 new_arkade: 2.3.0 latest: 2.3.0
vault - current_arkade: 1.11.2 new_arkade: 1.11.3 latest: 1.11.3
waypoint - current_arkade: 0.8.1 new_arkade: 0.10.0 latest: 0.10.0
packer - current_arkade: 1.8.0 new_arkade: 1.8.3 latest: 1.8.3 |
I would like to have this one. It will be useful to have the newer versions available via arkade. For now I have an error for packer, terraform and probably other Hashicorp tools too :(
FYI @alexellis |
#767 also need consul but they are not using github releases :(, they are using hashicorp releases, maybe it is better to use hashicorp releases domain for every one of their products rather than any github releases? I didn't know they were shifting towards their domain releases, would be good to get info from hashicorp about this |
Related to #560
Description
In case a tool has a
URLTemplate
including https://releases.hashicorp.com ,it will fetch its latest release via the https://api.releases.hashicorp.com/v1/releases API querying for artifact
with an "oss" license class.
At the moment,
terraform
,vagrant
,vault
,waypoint
, andpacker
are being supported.This PR follows #560 request to have minimal changes to the
tools.go
module.Motivation and Context
design/approved
by a maintainer (required)How Has This Been Tested?
Running the unit tests and e2e, and installing manually
Are you a GitHub Sponsor yet (Yes/No?)
Types of changes
Documentation
./arkade get -o markdown
./arkade install --help
Checklist:
git commit -s