homebrew-core/Formula/glooctl.rb
2019-10-11 13:02:45 +02: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.6",
:revision => "3aa4e784c25c4ca632820c621c8d13aa111f155c"
head "https://github.com/solo-io/gloo.git"
bottle do
cellar :any_skip_relocation
sha256 "4875b94fe4bd5302d7d3ea8eb3aafaee3a74281bb9025f1ceb0bc635c335dfc9" => :catalina
sha256 "d8bf5a9e3a02577465d2c76f19dc463d5c12cff5e50340122fe67543de0eca98" => :mojave
sha256 "37e025059dba2b71ac5901b872fb9e0ca9fdd574d9d2e9b5670522b800f41021" => :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