32 lines
1 KiB
Ruby
32 lines
1 KiB
Ruby
|
class OpenshiftCli < Formula
|
||
|
desc "OpenShift command-line interface tools"
|
||
|
homepage "https://www.openshift.com/"
|
||
|
url "https://github.com/openshift/origin.git",
|
||
|
:tag => "v1.1.1",
|
||
|
:revision => "e1d9873c1d5711b83fd3dd7eefe83a88ceb92c08"
|
||
|
|
||
|
head "https://github.com/openshift/origin.git"
|
||
|
|
||
|
depends_on "go" => :build
|
||
|
|
||
|
def install
|
||
|
# this is necessary to avoid having the version marked as dirty
|
||
|
(buildpath/".git/info/exclude").atomic_write "/.brew_home"
|
||
|
|
||
|
system "make", "all", "WHAT=cmd/openshift", "GOFLAGS=-v"
|
||
|
|
||
|
arch = MacOS.prefer_64_bit? ? "amd64" : "x86"
|
||
|
bin.install "_output/local/bin/darwin/#{arch}/openshift"
|
||
|
bin.install_symlink "openshift" => "oc"
|
||
|
bin.install_symlink "openshift" => "oadm"
|
||
|
|
||
|
bash_completion.install Dir["contrib/completions/bash/*"]
|
||
|
end
|
||
|
|
||
|
test do
|
||
|
assert_match /^oc v#{version}$/, shell_output("#{bin}/oc version")
|
||
|
assert_match /^oadm v#{version}$/, shell_output("#{bin}/oadm version")
|
||
|
assert_match /^openshift v#{version}$/, shell_output("#{bin}/openshift version")
|
||
|
end
|
||
|
end
|