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.2.14", :revision => "2544a9f3b7b1039b470f5a1bb8bc3efab5ec26db" head "https://github.com/solo-io/gloo.git" bottle do cellar :any_skip_relocation sha256 "35930a7788954abd255e2ae6d122ccd09958a9435694b916eaa48e0a177051b6" => :catalina sha256 "9eca254a671b5fb710e14c5dd9809b0802e744175132d95f2651fc7e6874b8b6" => :mojave sha256 "477ac137cc74a3fb06d97fad5667cd122bd4faaf709c09c097e5f19ef04a81e0" => :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