2015-03-19 18:22:34 +00:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class DockerSwarm < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Turn a pool of Docker hosts into a single, virtual host"
|
2015-03-19 18:22:34 +00:00
|
|
|
homepage "https://github.com/docker/swarm"
|
2015-04-17 06:24:13 +00:00
|
|
|
url "https://github.com/docker/swarm/archive/v0.2.0.tar.gz"
|
|
|
|
sha256 "7c9bb5b820f740e2963edc37cb0a2fc8160d42537870bf4caedb09036276008f"
|
|
|
|
|
|
|
|
head "https://github.com/docker/swarm.git"
|
2015-03-19 18:22:34 +00:00
|
|
|
|
2015-03-19 18:55:30 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-04-17 07:30:02 +00:00
|
|
|
sha256 "b104c0a882af39060b3f0dc2859b4e72e4ce9802948681454848c79da87efb1f" => :yosemite
|
|
|
|
sha256 "dc68ea1fd995fe9e5a8532c8ad10aae33079545896a67a3f669d75e374e3de22" => :mavericks
|
|
|
|
sha256 "be2da9ac833e4283be4a0182d63ef19051aad23f0c3f8905c64d23f2a7205096" => :mountain_lion
|
2015-03-19 18:55:30 +00:00
|
|
|
end
|
|
|
|
|
2015-03-19 18:22:34 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
2015-04-17 06:24:13 +00:00
|
|
|
def install
|
|
|
|
mkdir_p buildpath/"src/github.com/docker"
|
|
|
|
ln_s buildpath, buildpath/"src/github.com/docker/swarm"
|
2015-03-19 18:22:34 +00:00
|
|
|
|
2015-04-17 06:24:13 +00:00
|
|
|
ENV["GOPATH"] = "#{buildpath}/Godeps/_workspace:#{buildpath}"
|
2015-03-19 18:22:34 +00:00
|
|
|
|
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
|
2015-04-17 06:24:13 +00:00
|
|
|
system "go", "build", "-o", "docker-swarm"
|
2015-03-19 18:22:34 +00:00
|
|
|
|
|
|
|
bin.install "docker-swarm"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-04-17 06:24:13 +00:00
|
|
|
output = shell_output(bin/"docker-swarm --version")
|
|
|
|
assert output.include? "swarm version 0.2.0 (HEAD)"
|
2015-03-19 18:22:34 +00:00
|
|
|
end
|
|
|
|
end
|