homebrew-core/Formula/glooctl.rb
2019-04-23 16:34:24 +08: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.13.18",
:revision => "83aeaa36faf252f6389ce4dadb15a7e1710c9b2b"
head "https://github.com/solo-io/gloo.git"
bottle do
cellar :any_skip_relocation
sha256 "295a75e7a40549c52305e90ac387eb7c64e3f667d82f1891e1472a79d4e7ff0e" => :mojave
sha256 "e6d79e4405ea5d7a5a7b50e7817d5a7630332daf54a76555235070e5c203e884" => :high_sierra
sha256 "62bcc48615cddb8c8015665426c96d5e73bd90e2588caaa5560b22ab262e9c16" => :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