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

Homebrew #127

Open
neur0manc opened this issue Apr 13, 2021 · 7 comments
Open

Homebrew #127

neur0manc opened this issue Apr 13, 2021 · 7 comments

Comments

@neur0manc
Copy link

Could be nice to have our releases available in homebrew, so mac users can just brew install gscloud to install the client.

Considering hcloud (hetzners client), google and others have their clients in homebrew it shouldn't be a problem to get ours in there as well. As an example, here's the hcloud formula.

@nvthongswansea
Copy link
Member

+1

@fkr
Copy link
Contributor

fkr commented Apr 13, 2021

I actually have a ready-to-go formulae here, did that last weekend. Will submit soon.

@fkr fkr self-assigned this Apr 13, 2021
@fkr
Copy link
Contributor

fkr commented Apr 23, 2021

I will submit the homebrew formulae upstream as soon as #131 is fixed.

@patric-dosch-vi
Copy link

are there any news?

@fkr fkr removed their assignment Jul 19, 2022
@henrikvolmer
Copy link

+1

@ghostwheel42
Copy link
Contributor

ghostwheel42 commented Jul 26, 2022

I've attached a working homebrew formula for gscloud. The only "problem" is this:

$ brew audit --new-formula gscloud
gscloud:
  * GitHub repository not notable enough (<30 forks, <30 watchers and <75 stars)
Error: 1 problem in 1 formula detected

I don't know if we should submit the formula anyway.
The generation of a new formula can and should be automated for a new release.

class Gscloud < Formula
  desc "Official command-line interface for the gridscale API"
  homepage "https://gridscale.io/"
  url "https://github.com/gridscale/gscloud/archive/refs/tags/v0.12.0.tar.gz"
  sha256 "20927acda1fff7372bd6de11dcd40b0b6143aa6668d88b79d181cd9ccf5440f4"
  license "MIT"
  head "https://github.com/gridscale/gscloud.git", branch: "master"

  depends_on "go" => :build

  def install
    ldflags = %W[
      -s -w
      -X github.com/gridscale/gscloud/cmd.Version=#{version}
    ]

    system "go", "build", *std_go_args(ldflags: ldflags)

    # currently gscloud needs at least an empty config to run
    touch "config.yaml"
    (zsh_completion/"_gscloud").write `#{bin}/gscloud completion zsh`
    (bash_completion/"gscloud").write `#{bin}/gscloud completion bash`
  end

  test do
    # currently gscloud needs at least an empty config to run
    touch "config.yaml"
    assert_match "Version:\t#{version}", shell_output("#{bin}/gscloud version")
    assert_match "gscloud lets you manage", shell_output("#{bin}/gscloud help")
  end
end

@henrikvolmer
Copy link

I would appreciate it if you submit the form anyway :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants