homebrew-core/Formula/kubernetes-helm.rb
2018-12-20 14:34:35 +11:00

55 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.1",
:revision => "02a47c7249b1fc6d8fd3b94e6b4babf9d818144e"
head "https://github.com/helm/helm.git"
bottle do
cellar :any_skip_relocation
sha256 "2898615f11b902a64b662565286cc01c809ab817beaa1308488d89bd85930748" => :mojave
sha256 "45ccc763cf02796cc9faa77f35fb8445244b92064c9e512157bb341e7730cd5a" => :high_sierra
sha256 "f2402b731d576a069d82a98f94789203905291f4fd9039287d8f35427efe56a8" => :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"
arch = MacOS.prefer_64_bit? ? "amd64" : "x86"
ENV["TARGETS"] = "darwin/#{arch}"
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