44 lines
1.5 KiB
Ruby
44 lines
1.5 KiB
Ruby
class Glooctl < Formula
|
|
desc "Envoy-Powered API Gateway"
|
|
homepage "https://docs.solo.io/gloo/latest/"
|
|
url "https://github.com/solo-io/gloo.git",
|
|
:tag => "v1.3.9",
|
|
:revision => "ba63e8817b80bce62f421986803343c83ad878b9"
|
|
head "https://github.com/solo-io/gloo.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "7993039214e27f71bee64fd8258e8b2923c6ca5d62b91f7eb9e8d8d6b3f07867" => :catalina
|
|
sha256 "4e2c9054eaf9bce2b1c4ee8d04554f16b0982b3db5b6cdef380601544c08f805" => :mojave
|
|
sha256 "17b3f30dac97c7c0d6916883c18222f6f510189957e8e81d717137b2115493e9" => :high_sierra
|
|
end
|
|
|
|
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 "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 kube client", status_output
|
|
end
|
|
end
|