homebrew-core/Formula/kubernetes-helm.rb
2017-04-07 12:04:49 +02:00

49 lines
1.5 KiB
Ruby

class KubernetesHelm < Formula
desc "The Kubernetes package manager"
homepage "https://helm.sh/"
url "https://github.com/kubernetes/helm.git",
:tag => "v2.3.0",
:revision => "d83c245fc324117885ed83afc90ac74afed271b4"
head "https://github.com/kubernetes/helm.git"
bottle do
cellar :any_skip_relocation
sha256 "3e8e6b64c97d4c7c7cb059d59b676dd44c876e45a62519bbcc89c7b983495172" => :sierra
sha256 "5d6326473bbae993cae7ea7aeb208a2d8bb8ab74e5c84ec43f172d370093d376" => :el_capitan
sha256 "ead7afa6add6d550318bf6113147c50a8cdb47fda69dc93820e79331478532ae" => :yosemite
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
# Bootstap build
system "make", "bootstrap"
# Make binary
system "make", "build"
bin.install "bin/helm"
# Install bash completion
bash_completion.install "scripts/completions.bash" => "helm"
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
end
end