alexellis / arkade

Open Source Marketplace For Developer Tools
https://blog.alexellis.io/kubernetes-marketplace-two-year-update/
MIT License
4.25k stars 289 forks source link

[Tools] - arkade get should be able to cope with tgz/zip and multi-file archives #123

Closed alexellis closed 4 years ago

alexellis commented 4 years ago

Today arkade can download a single binary from a release page using a Go template to form the URL.

# arkade get faas-cli

Downloading faas-cli
https://github.com/openfaas/faas-cli/releases/download/0.12.4/faas-cli-darwin
Tool written to: /var/folders/p7/ptxtv_pd3n12fd6mc5wjhk1h0000gn/T/faas-cli-darwin

Run the following to copy to install the tool:

chmod +x /var/folders/p7/ptxtv_pd3n12fd6mc5wjhk1h0000gn/T/faas-cli-darwin
sudo install -m 755 /var/folders/p7/ptxtv_pd3n12fd6mc5wjhk1h0000gn/T/faas-cli-darwin /usr/local/bin/faas-cli

Helm, however ships as a compressed multi-file archive with the binary inside. We do download this automatically via arkade install but the behaviour should be adapted for arkade get so that we can add helm and similar CLIs i.e. arkade get helm downloads the helm binary.

kubectx now ships as a single-file archive with a single binary inside, this is a simpler case, but still involves more code paths and conditional statements. Until this feature is completed, we can just use the bash variant which is going to exist for a while yet and is not compressed.

Ideally we should support:

Changes will be required in:

https://github.com/alexellis/arkade/blob/master/cmd/get.go

And

https://github.com/alexellis/arkade/blob/master/pkg/get/get.go

alexellis commented 4 years ago

/add label: good first issue, help wanted

alexellis commented 4 years ago

There will be common code between get.go and `helm.go -> https://github.com/alexellis/arkade/blob/master/pkg/helm/helm.go#L23

Some common code can be extracted here for re-use, but the first implementation would be fine with some duplication making it easier to review.