53 lines
1.8 KiB
Ruby
53 lines
1.8 KiB
Ruby
class KubernetesCli < Formula
|
|
desc "Kubernetes command-line interface"
|
|
homepage "http://kubernetes.io/"
|
|
url "https://github.com/kubernetes/kubernetes.git",
|
|
:tag => "v1.5.3",
|
|
:revision => "029c3a408176b55c30846f0faedf56aae5992e9b"
|
|
head "https://github.com/kubernetes/kubernetes.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "029487405e14015b7d5b1b4b68e3ba07b9ec85fc8529b2de2fd4088372914f0e" => :sierra
|
|
sha256 "3b2013779d363de138c1f2f87d440ec7def934d3d4548cd430b3b3ab5b4fe8be" => :el_capitan
|
|
sha256 "92f439b9b69f56e6cbfe3784b4a48041134c524fa9e7aee9605e9f8388f189dd" => :yosemite
|
|
end
|
|
|
|
devel do
|
|
url "https://github.com/kubernetes/kubernetes.git",
|
|
:tag => "v1.6.0-alpha.2",
|
|
:revision => "7738f41b958bd8a8018333b9c3eb86c563e1ee1a"
|
|
version "1.6.0-alpha.2"
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
|
|
def install
|
|
ENV["GOPATH"] = buildpath
|
|
arch = MacOS.prefer_64_bit? ? "amd64" : "x86"
|
|
dir = buildpath/"src/k8s.io/kubernetes"
|
|
dir.install buildpath.children - [buildpath/".brew_home"]
|
|
|
|
cd dir do
|
|
# Race condition still exists in OSX Yosemite
|
|
# Filed issue: https://github.com/kubernetes/kubernetes/issues/34635
|
|
ENV.deparallelize { system "make", "generated_files" }
|
|
|
|
# Make binary
|
|
system "make", "kubectl"
|
|
bin.install "_output/local/bin/darwin/#{arch}/kubectl"
|
|
|
|
# Install bash completion
|
|
output = Utils.popen_read("#{bin}/kubectl completion bash")
|
|
(bash_completion/"kubectl").write output
|
|
end
|
|
end
|
|
|
|
test do
|
|
run_output = shell_output("#{bin}/kubectl 2>&1")
|
|
assert_match "kubectl controls the Kubernetes cluster manager.", run_output
|
|
|
|
version_output = shell_output("#{bin}/kubectl version --client 2>&1")
|
|
assert_match "GitTreeState:\"clean\"", version_output
|
|
end
|
|
end
|