homebrew-core/Formula/kubernetes-helm.rb
2019-01-14 19:09:47 -05:00

54 lines
1.8 KiB
Ruby

class KubernetesHelm < Formula
desc "The Kubernetes package manager"
homepage "https://helm.sh/"
url "https://github.com/helm/helm.git",
:tag => "v2.12.2",
:revision => "7d2b0c73d734f6586ed222a567c5d103fed435be"
head "https://github.com/helm/helm.git"
bottle do
cellar :any_skip_relocation
sha256 "4158a25a57f57ee7d663b7910ebc1e575437b149c43348d0d78b2dfc16e02df5" => :mojave
sha256 "0ee5e8485a1f13631da72cced9cc7804c9882727a3dac67201898a4be8fc7a13" => :high_sierra
sha256 "915d6e6642f2078f8a68563d1d94fdc310232ecb43f07d1497c69dba047aefb1" => :sierra
end
depends_on "glide" => :build
depends_on "go" => :build
depends_on "mercurial" => :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/k8s.io/helm"
dir.install buildpath.children - [buildpath/".brew_home"]
cd dir do
system "make", "bootstrap"
system "make", "build"
bin.install "bin/helm"
bin.install "bin/tiller"
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 --client 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