homebrew-core/Formula/sonobuoy.rb
2019-11-06 09:04:50 +09:00

45 lines
1.8 KiB
Ruby

class Sonobuoy < Formula
desc "Kubernetes component that generates reports on cluster conformance"
homepage "https://github.com/heptio/sonobuoy"
url "https://github.com/heptio/sonobuoy/archive/v0.16.3.tar.gz"
sha256 "d9d47709fa23b670e931586683c71d842761aba3155eff146bd2d41c5a60ce51"
bottle do
cellar :any_skip_relocation
sha256 "dd6c9dd3de6869fac6f313b14d5103da84f62dbbd64a25b7e956318272d466e9" => :catalina
sha256 "ef8ef736e1aff7a9c2fa23a0934246901fe0bf4552cf25b48aa292c5e96d8c53" => :mojave
sha256 "42d58ef91b2be40c08800bb5a445a75d0eed8aaa772d832c936b4f3d19e5cf2e" => :high_sierra
end
depends_on "go" => :build
resource "sonobuoyresults" do
url "https://raw.githubusercontent.com/heptio/sonobuoy/master/pkg/client/results/testdata/results-0.10.tar.gz"
sha256 "a945ba4d475e33820310a6138e3744f301a442ba01977d38f2b635d2e6f24684"
end
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/heptio/sonobuoy").install buildpath.children
cd "src/github.com/heptio/sonobuoy" do
system "go", "build", "-o", bin/"sonobuoy", "-installsuffix", "static",
"-ldflags",
"-s -w -X github.com/heptio/sonobuoy/pkg/buildinfo.Version=#{version}",
"./"
prefix.install_metafiles
end
end
test do
output = shell_output("#{bin}/sonobuoy 2>&1")
assert_match "Sonobuoy is an introspective kubernetes component that generates reports on cluster conformance", output
assert_match version.to_s, shell_output("#{bin}/sonobuoy version 2>&1")
output = shell_output("#{bin}/sonobuoy gen --kube-conformance-image-version=v1.14 2>&1")
assert_match "name: sonobuoy", output
output = shell_output("#{bin}/sonobuoy e2e --show=all " + resource("sonobuoyresults").cached_download + " 2>&1")
assert_match "all tests", output
end
end