50 lines
1.5 KiB
Ruby
50 lines
1.5 KiB
Ruby
class OperatorSdk < Formula
|
|
desc "SDK for building Kubernetes applications"
|
|
homepage "https://coreos.com/operators/"
|
|
url "https://github.com/operator-framework/operator-sdk/archive/v0.7.0.tar.gz"
|
|
sha256 "19c1fd70e4ca1242667552dc6a087bfeb2e019fffcfdbe2d7295475a7596126c"
|
|
head "https://github.com/operator-framework/operator-sdk.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "c0d960f2fd7300a238abbd28cba72ac3a4cbec900aa409848f38714de20fe1f4" => :mojave
|
|
sha256 "9f4b02edeec0566630e98de58bf08172d4ef2ffb9316c01917b094730f4fe16a" => :high_sierra
|
|
sha256 "b214d20ecac6cf3c8e20d7e2d99026385bde40d652863a7480c9199f2d2b2ef1" => :sierra
|
|
end
|
|
|
|
depends_on "dep"
|
|
depends_on "go"
|
|
|
|
def install
|
|
ENV["GOPATH"] = buildpath
|
|
dir = buildpath/"src/github.com/operator-framework/operator-sdk"
|
|
dir.install buildpath.children - [buildpath/".brew_home"]
|
|
|
|
cd dir do
|
|
# Make binary
|
|
system "make", "install"
|
|
bin.install buildpath/"bin/operator-sdk"
|
|
|
|
# Install bash completion
|
|
output = Utils.popen_read("#{bin}/operator-sdk completion bash")
|
|
(bash_completion/"operator-sdk").write output
|
|
|
|
# Install zsh completion
|
|
output = Utils.popen_read("#{bin}/operator-sdk completion zsh")
|
|
(zsh_completion/"_operator-sdk").write output
|
|
|
|
prefix.install_metafiles
|
|
end
|
|
end
|
|
|
|
test do
|
|
ENV["GOPATH"] = testpath
|
|
dir = testpath/"src/example.com/test-operator"
|
|
dir.mkpath
|
|
|
|
cd dir do
|
|
# Create a new, blank operator framework
|
|
system "#{bin}/operator-sdk", "new", "test"
|
|
end
|
|
end
|
|
end
|