c-bata / kube-prompt

An interactive kubernetes client featuring auto-complete.
MIT License
1.79k stars 134 forks source link

Register at a homebrew official repository #11

Closed c-bata closed 3 years ago

c-bata commented 6 years ago

kube-prompt is gradually becoming a little bit famous. So perhaps it is the worth to register at a homebrew official repository. It is a little bit comfortable because we don't need brew tap.

c-bata commented 6 years ago

Is there a someone who want to register kube-prompt at homebrew official repository?

yermulnik commented 3 years ago

Is it possible to add Linux flavour to brew formulae? Currently it installs MacOS binary on Linux:

> uname -srm
Linux 4.4.0-200-generic x86_64

> brew install c-bata/kube-prompt/kube-prompt
==> Tapping c-bata/kube-prompt
Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/c-bata/homebrew-kube-prompt'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 33 (delta 0), reused 2 (delta 0), pack-reused 30
Receiving objects: 100% (33/33), done.
Resolving deltas: 100% (9/9), done.
Tapped 1 formula (26 files, 99.9KB).
==> Installing kube-prompt from c-bata/kube-prompt
==> Downloading https://github.com/c-bata/kube-prompt/releases/download/v1.0.10/kube-prompt_v1.0.10_darwin_amd64.zip
==> Downloading from https://github-releases.githubusercontent.com/100288067/7fb1f900-1592-11ea-99d6-ac1cccbb4ee4?X-Amz-
######################################################################## 100.0%
🍺  /home/linuxbrew/.linuxbrew/Cellar/kube-prompt/1.0.10: 3 files, 31.6MB, built in 1 second

> file /home/linuxbrew/.linuxbrew/Cellar/kube-prompt/1.0.10/bin/kube-prompt
/home/linuxbrew/.linuxbrew/Cellar/kube-prompt/1.0.10/bin/kube-prompt: Mach-O 64-bit x86_64 executable

Thanks in advance

c-bata commented 3 years ago

Hi @yermulnik! Thank you for your comment.

I've just checked the Formulae Cookbook but found no descriptions to support Linux. https://docs.brew.sh/Formula-Cookbook

Do you know how to write Homebrew Formulae for Linux? The formulae is on following repository so that I'm also welcome your pull request if you can. https://github.com/c-bata/homebrew-kube-prompt

yermulnik commented 3 years ago

Hi @c-bata

Unfortunately I'm not very familiar with brew yet to provider proper PR for the kube-prompt formulae but this looks to be a quick example which fits this case: https://github.com/minamijoyo/homebrew-tfupdate/blob/master/tfupdate.rb

I've also took a look through some of formulaes with Linux support but most of these seem to be too complicated for me to understand how these work w/o good knowledge with brew formulaes: https://formulae.brew.sh/formula-linux/

Let me know whether you're fine with the way tfupdate formulae is constructed and I'll try and replicate this via PR to https://github.com/c-bata/homebrew-kube-prompt

c-bata commented 3 years ago

@yermulnik I'm really sorry for the delayed response.

Let me know whether you're fine with the way tfupdate formulae is constructed and I'll try and replicate this via PR to https://github.com/c-bata/homebrew-kube-prompt

Welcome. I will review your pull request.

yermulnik commented 3 years ago

@c-bata No worries. Here it is: https://github.com/c-bata/homebrew-kube-prompt/pull/2 Verified to be functional on Linux:

> brew reinstall kube-prompt
==> Downloading https://github.com/c-bata/kube-prompt/releases/download/v1.0.11/kube-prompt_v1.0.11_linux_amd64.zip
==> Downloading from https://github-releases.githubusercontent.com/100288067/90281100-6b51-11eb-8d29-0058cc5def4a?X-Amz-
######################################################################## 100.0%
==> Reinstalling c-bata/kube-prompt/kube-prompt
🍺  /home/linuxbrew/.linuxbrew/Cellar/kube-prompt/1.0.11: 3 files, 36MB, built in 2 seconds

> file /home/linuxbrew/.linuxbrew/bin/kube-prompt
/home/linuxbrew/.linuxbrew/bin/kube-prompt: symbolic link to ../Cellar/kube-prompt/1.0.11/bin/kube-prompt

> file /home/linuxbrew/.linuxbrew/bin/../Cellar/kube-prompt/1.0.11/bin/kube-prompt
/home/linuxbrew/.linuxbrew/bin/../Cellar/kube-prompt/1.0.11/bin/kube-prompt: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, not stripped

> /home/linuxbrew/.linuxbrew/bin/kube-prompt
error invalid configuration: no configuration has been provided

You also may want to look into GoReleaser to re-generate homebrew formulae when releasing new version: https://goreleaser.com/customization/homebrew/

c-bata commented 3 years ago

I merged your PR. Thank you for your contribution.

error invalid configuration: no configuration has been provided

Hmm... The error seems to be related to https://github.com/c-bata/kube-prompt/issues/54.

c-bata commented 3 years ago

Let me close this issue since I lost the motivation to register at HomeBrew official repository.

yermulnik commented 3 years ago

@c-bata Thanks for merging PR.

Hmm... The error seems to be related to #54.

Nah, disregard this. This was just to show that I got correct binary installed with the fixed brew formulae. And kube-prompt errored out just because I didn't have any kube config in place. Thanks!