homebrew-core/Formula/glooctl.rb
2019-07-24 07:50:39 +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.17.6",
:revision => "b9093df1dff5cc362cd56f7dc0c6f3c93c485046"
head "https://github.com/solo-io/gloo.git"
bottle do
cellar :any_skip_relocation
sha256 "950946e9a5238d2ad5a29544ce376b71868cce73fd1adaf67e1865023a0f56d8" => :mojave
sha256 "7950eb2edd47f01e2e62776e117f8e2956a8a859c4d515f4266186c2c762df14" => :high_sierra
sha256 "13e66a3bce2cb9877dd67e4b20fd63cb54c07413e06482753912515d58e8747a" => :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