homebrew-core/Formula/kubernetes-helm.rb

50 lines
1.7 KiB
Ruby

class KubernetesHelm < Formula
desc "The Kubernetes package manager"
homepage "https://helm.sh/"
url "https://github.com/kubernetes/helm.git",
:tag => "v2.7.2",
:revision => "8478fb4fc723885b155c924d1c8c410b7a9444e6"
head "https://github.com/kubernetes/helm.git"
bottle do
cellar :any_skip_relocation
sha256 "999268c0f30c9bd13ad294cd96fbd22b05e0db36dd866c357909936d72c1dd2c" => :high_sierra
sha256 "5d5c1b7c4ae997eb4ebbbb66c2014853a35e3d9a47d0a50e64165aab4b31e7a5" => :sierra
sha256 "52383d0994f28405d12c8589b28899a3035d66e8853e46b6917228a0fe664c70" => :el_capitan
end
depends_on :hg => :build
depends_on "go" => :build
depends_on "glide" => :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/*"]
bash_completion.install "scripts/completions.bash" => "helm"
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