37 lines
1.1 KiB
Ruby
37 lines
1.1 KiB
Ruby
|
class Landscaper < Formula
|
||
|
desc "Manage the application landscape in a Kubernetes cluster"
|
||
|
homepage "https://github.com/Eneco/landscaper"
|
||
|
url "https://github.com/Eneco/landscaper.git",
|
||
|
:tag => "1.0.10",
|
||
|
:revision => "c715c3b05d73ee8baf6b1c141524ff90ed80af2e"
|
||
|
head "https://github.com/Eneco/landscaper.git"
|
||
|
|
||
|
depends_on "go" => :build
|
||
|
depends_on "glide" => :build
|
||
|
depends_on "kubernetes-cli" => :run
|
||
|
depends_on "kubernetes-helm" => :run
|
||
|
|
||
|
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/github.com/eneco/landscaper"
|
||
|
dir.install buildpath.children - [buildpath/".brew_home"]
|
||
|
|
||
|
cd dir do
|
||
|
# Bootstap build
|
||
|
system "make", "bootstrap"
|
||
|
|
||
|
# Make binary
|
||
|
system "make", "build"
|
||
|
bin.install "build/landscaper"
|
||
|
end
|
||
|
end
|
||
|
|
||
|
test do
|
||
|
assert_match "This is Landscaper v#{version}", pipe_output("#{bin}/landscaper apply 2>&1")
|
||
|
end
|
||
|
end
|