homebrew-core/Formula/helm.rb

46 lines
1.4 KiB
Ruby

class Helm < Formula
desc "The Kubernetes package manager"
homepage "https://helm.sh/"
url "https://github.com/helm/helm.git",
tag: "v3.3.1",
revision: "249e5215cde0c3fa72e27eb7a30e8d55c9696144"
license "Apache-2.0"
head "https://github.com/helm/helm.git"
bottle do
cellar :any_skip_relocation
sha256 "117f91c43b63eeacd75ecff80bb3de44cdf69a221a3419d6321b3eaea2aa9c0d" => :catalina
sha256 "3c053e558031d4ce17c111237fb6e0d69f0a5bd696595c4c2910a4bcbacf7050" => :mojave
sha256 "8857b72ab199eac53f8b7c174684ce8fba89bcd8eaec335b9d568dcd21dc1dc2" => :high_sierra
end
depends_on "go" => :build
def install
system "make", "build"
bin.install "bin/helm"
mkdir "man1" do
system bin/"helm", "docs", "--type", "man"
man1.install Dir["*"]
end
output = Utils.safe_popen_read({ "SHELL" => "bash" }, bin/"helm", "completion", "bash")
(bash_completion/"helm").write output
output = Utils.safe_popen_read({ "SHELL" => "zsh" }, bin/"helm", "completion", "zsh")
(zsh_completion/"_helm").write output
end
test do
system "#{bin}/helm", "create", "foo"
assert File.directory? "#{testpath}/foo/charts"
version_output = shell_output("#{bin}/helm version 2>&1")
assert_match "Version:\"v#{version}\"", version_output
if build.stable?
assert_match stable.instance_variable_get(:@resource).instance_variable_get(:@specs)[:revision], version_output
end
end
end