42 lines
1.5 KiB
Ruby
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.0",
|
|
:revision => "19da3dd650e1cb697b5d69d10aa6205a18498699"
|
|
head "https://github.com/solo-io/gloo.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "793766e5d46c5cd1e42bc9f243fab074ae1c8e5089c5e0d9b3687444b135a4e4" => :mojave
|
|
sha256 "001535595f8f34762f4d6245b5b034ce2c2ffef17bd55058dfdae7d369734cb8" => :high_sierra
|
|
sha256 "cdc8b3c36d572d9933fdabbfd44f7b09781a0c899e577873d110a742487bb156" => :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
|