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-07-25 09:12:19 +00:00
|
|
|
url "https://github.com/docker/swarm/archive/v0.3.0.tar.gz"
|
|
|
|
sha256 "3db5f261483b87330743e16b340a2f76349e2dcca6b1dd85b9e1b1288d50af22"
|
2015-04-17 06:24:13 +00:00
|
|
|
|
|
|
|
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-07-25 21:56:09 +00:00
|
|
|
sha256 "6a8a15a511cd1bf5f10c9e53af8784d06d51fdd359ab533dfe8daaa7a6c872b3" => :yosemite
|
|
|
|
sha256 "33f60f41343326f549c886ed60564a1672877f77c8636962d8c4c47c10d62f05" => :mavericks
|
|
|
|
sha256 "e6b63640e4ff88d073c0449ea23a3c8c3ff46caffc72c3e4d4a2e159ffade10d" => :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")
|
2015-07-25 09:12:19 +00:00
|
|
|
assert_match "swarm version #{version} (HEAD)", output
|
2015-03-19 18:22:34 +00:00
|
|
|
end
|
|
|
|
end
|