homebrew-core/Formula/helm.rb

51 lines
1.6 KiB
Ruby

class Helm < Formula
desc "The Kubernetes package manager"
homepage "https://helm.sh/"
url "https://github.com/helm/helm.git",
:tag => "v3.1.1",
:revision => "afe70585407b420d0097d07b21c47dc511525ac8"
head "https://github.com/helm/helm.git"
bottle do
cellar :any_skip_relocation
sha256 "28fe58e7c52754887d08a060a86ec6df03b0774e6c02eed63f6fa20d32155078" => :catalina
sha256 "aa39d394e967a4a6a57093f744d5b9a8283f9ad76513264e0e03b979b43fed24" => :mojave
sha256 "24e7fcc7c0fdffc2e0f5ce5f6cfd79425c1832517a91152ae402de358fcdf8ef" => :high_sierra
end
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
ENV["GLIDE_HOME"] = HOMEBREW_CACHE/"glide_home/#{name}"
ENV.prepend_create_path "PATH", buildpath/"bin"
ENV["TARGETS"] = "darwin/amd64"
dir = buildpath/"src/helm.sh/helm"
dir.install buildpath.children - [buildpath/".brew_home"]
cd dir do
system "make", "build"
bin.install "bin/helm"
man1.install Dir["docs/man/man1/*"]
output = Utils.popen_read("SHELL=bash #{bin}/helm completion bash")
(bash_completion/"helm").write output
output = Utils.popen_read("SHELL=zsh #{bin}/helm completion zsh")
(zsh_completion/"_helm").write output
prefix.install_metafiles
end
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 "GitTreeState:\"clean\"", version_output
assert_match stable.instance_variable_get(:@resource).instance_variable_get(:@specs)[:revision], version_output if build.stable?
end
end