homebrew-core/Formula/glooctl.rb
2019-08-09 18:36:33 -04: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.18.14",
:revision => "9ac158e48b81e6314ee1efed5263dc4b9cd2a288"
head "https://github.com/solo-io/gloo.git"
bottle do
cellar :any_skip_relocation
sha256 "14a162e49b0c2fcd1bd9303a181c6e676c89e094dce2c79b8c04e92e55fd4713" => :mojave
sha256 "5f80fe69d72bd58d40dca0060ff503bb3931eb301da73985d7f6ea6da0cb4508" => :high_sierra
sha256 "dbe8a356479aa53ee118dee31c76a3c84908a9e37f0db73cd9467f08ce77c9dc" => :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