homebrew-core/Formula/glooctl.rb
2019-09-07 09:26:46 +02:00

42 lines
1.5 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.18.37",
:revision => "93fd7499b01bec5d1d29f4b06a8c67943ab7726d"
head "https://github.com/solo-io/gloo.git"
bottle do
cellar :any_skip_relocation
sha256 "6ba2c7132a53a57f6d6e2cf20b0592995ce421c358d3e59f8ebfb207d77fdbc0" => :mojave
sha256 "d96adc9e42ebc8274ce60b22c805083f2542f48e1b02827115c38ef81af70091" => :high_sierra
sha256 "c48c81e51049146d136a29c933511c5d11dd8328cae7edb2ddb4d4b397f53a19" => :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 "glooctl community edition version #{version}", 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