Skip to content
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

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

Closed
alexellis opened this issue Jun 16, 2020 · 2 comments · Fixed by #133
Closed

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

alexellis opened this issue Jun 16, 2020 · 2 comments · Fixed by #133
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@alexellis
Copy link
Owner

alexellis commented Jun 16, 2020

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:

  • single binary - (faas-cli, kubectx)
  • single binary - compressed (tar.gz) (kubectx)
  • multi-file archive - where we want a single binary to be pulled out of it (helm)

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
Copy link
Owner Author

/add label: good first issue, help wanted

@derek derek bot added good first issue Good for newcomers help wanted Extra attention is needed labels Jun 16, 2020
@alexellis
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
1 participant