class Glooctl < Formula desc "Envoy-Powered API Gateway" homepage "https://gloo.solo.io" url "https://github.com/solo-io/gloo.git", :tag => "v0.18.16", :revision => "d4968cc7c09b7c7818a54c647c48730219dfe68b" head "https://github.com/solo-io/gloo.git" bottle do cellar :any_skip_relocation sha256 "939c2c841be947dd9a9ea24a28c6ec1487d1bba9fcacc2399739a80726e508a8" => :mojave sha256 "75487131fde3fc455bdd1f9666993a395630c4b90a9fd4061dfa755bbff008f5" => :high_sierra sha256 "6561074d565aa1886d3d17bc8e1c822a037992a200446e50b15173abf723a225" => :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