homebrew-core/Formula/sonobuoy.rb
2020-01-08 06:55:04 -05:00

48 lines
1.9 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.17.1.tar.gz"
sha256 "33e8d092bd554bf3293c3d0e9339a1371665b7fc6bc0926682400fbfeb7691f9"
bottle do
cellar :any_skip_relocation
sha256 "629d991fbb0fd643f548f201bac38096066faab23c8d949825b33761bdb178a9" => :catalina
sha256 "3b04c462e136b0d42bb4c263903276a1bd443fee82de33f523bf3ccf5828393c" => :mojave
sha256 "fc2a9af268e2a589c0fedaab200933c20c71e8c320b134dca629954cc24916fe" => :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
resources.each do |r|
r.verify_download_integrity(r.fetch)
end
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