53 lines
1.7 KiB
Ruby
53 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.3.1",
|
|
:revision => "32562a3040bb5ca690339b9840b6f60f8ce25da4"
|
|
head "https://github.com/kubernetes/helm.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "76bbd83bd12ef47901814c4b48682416a18559b868839453d1c2d26c21a0f89f" => :sierra
|
|
sha256 "a64f6d4145fc0dbbfe32f219397e0c979d24aea68ce99c33459a62e6bed86846" => :el_capitan
|
|
sha256 "5be9c707046fc54d8aa291708d169b8633128360fd7c3e35cc5ae614cc8ebe76" => :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 man pages
|
|
man1.install Dir["docs/man/man1/*"]
|
|
|
|
# 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
|
|
assert_match stable.instance_variable_get(:@resource).instance_variable_get(:@specs)[:revision], version_output if build.stable?
|
|
end
|
|
end
|