homebrew-core/Formula/glooctl.rb

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.4.0",
:revision => "6ca365d2d47c4f588b3218cbd02ee4ef14d8dcb0"
head "https://github.com/solo-io/gloo.git"
bottle do
cellar :any_skip_relocation
sha256 "8177a8144948901cd3e21d0db8b57f13c0b2fc0f0370978a01c8324e8944f076" => :catalina
sha256 "a1ecfb9ce99ba819b4e2449a98dac401b81aa3d9a537a31aafdcc0ceedebe454" => :mojave
sha256 "027d0f62fae779d0913f57115eaf141f27ff5387aed4afc3885cdec087fcc2d2" => :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