homebrew-core/Formula/glooctl.rb
2019-10-29 21:56:01 +09:00

45 lines
1.6 KiB
Ruby

class Glooctl < Formula
desc "Envoy-Powered API Gateway"
homepage "https://gloo.solo.io"
url "https://github.com/solo-io/gloo.git",
:tag => "v0.20.11",
:revision => "26ec451ba817a62cf01cbf125fcf8c873fc47d1e"
head "https://github.com/solo-io/gloo.git"
bottle do
cellar :any_skip_relocation
sha256 "ade804aa680595c12e274a19eb4ddf9406e8b4a0a8ed1deb10d71fbd3d8e18ab" => :catalina
sha256 "892b2d2b6fae4902d19640498a147edcb6892c66772510400f9cef28effdec55" => :mojave
sha256 "6b7a739be57baace742c7ad9818c572e93f38a940d00c2f8e41c69de54c09fab" => :high_sierra
end
depends_on "dep" => :build
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
dir = buildpath/"src/github.com/solo-io/gloo"
dir.install buildpath.children - [buildpath/".brew_home"]
cd dir do
system "dep", "ensure", "-vendor-only"
system "make", "glooctl", "TAGGED_VERSION=v#{version}"
bin.install "_output/glooctl"
end
end
test do
run_output = shell_output("#{bin}/glooctl 2>&1")
assert_match "glooctl is the unified CLI for Gloo.", run_output
version_output = shell_output("#{bin}/glooctl version 2>&1")
assert_match "Client: {\"version\":\"#{version}\"}", version_output
version_output = shell_output("#{bin}/glooctl version 2>&1")
assert_match "Server: version undefined", version_output
# Should error out as it needs access to a Kubernetes cluster to operate correctly
status_output = shell_output("#{bin}/glooctl get proxy 2>&1", 1)
assert_match "failed to create proxy client", status_output
end
end