2015-07-12 17:17:18 +00:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class Consul < Formula
|
|
|
|
desc "Tool for service discovery, monitoring and configuration"
|
|
|
|
homepage "https://www.consul.io"
|
|
|
|
url "https://github.com/hashicorp/consul.git",
|
2016-01-24 08:01:06 +00:00
|
|
|
:tag => "v0.6.3", :revision => "c933efde50d25395c7b5a42167578fda603d43d8"
|
2015-07-12 17:17:18 +00:00
|
|
|
|
2016-02-04 00:51:05 +00:00
|
|
|
head "https://github.com/hashicorp/consul.git", :shallow => false
|
|
|
|
|
2015-07-12 21:58:03 +00:00
|
|
|
bottle do
|
2015-12-13 23:53:24 +00:00
|
|
|
cellar :any_skip_relocation
|
2016-01-24 08:15:44 +00:00
|
|
|
sha256 "68f49f7a77ecf9008e2d07e957b530392c57f5c0765c0caf3e2b5b623f6c291a" => :el_capitan
|
|
|
|
sha256 "6d10d26c6cef0ab909ba1fb7285259b4b045c50f02f46cf56bb6393c45af70c8" => :yosemite
|
|
|
|
sha256 "edc112792bdc15448c9ff102e2234eee0ca544d11c85f9a949a74719338bc535" => :mavericks
|
2015-07-12 21:58:03 +00:00
|
|
|
end
|
|
|
|
|
2015-09-01 17:51:42 +00:00
|
|
|
option "with-web-ui", "Installs the consul web ui"
|
|
|
|
|
2015-07-12 17:17:18 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
2015-12-12 16:04:11 +00:00
|
|
|
go_resource "github.com/DataDog/datadog-go" do
|
|
|
|
url "https://github.com/DataDog/datadog-go.git",
|
2016-01-10 21:32:22 +00:00
|
|
|
:revision => "bc97e0770ad4edae1c9dc14beb40b79b2dde32f8"
|
2015-12-12 16:04:11 +00:00
|
|
|
end
|
|
|
|
|
2015-07-12 17:17:18 +00:00
|
|
|
go_resource "github.com/armon/circbuf" do
|
|
|
|
url "https://github.com/armon/circbuf.git",
|
2015-12-12 16:04:11 +00:00
|
|
|
:revision => "bbbad097214e2918d8543d5201d12bfd7bca254d"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/armon/go-metrics" do
|
|
|
|
url "https://github.com/armon/go-metrics.git",
|
2016-01-10 21:32:22 +00:00
|
|
|
:revision => "345426c77237ece5dab0e1605c3e4b35c3f54757"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/armon/go-radix" do
|
|
|
|
url "https://github.com/armon/go-radix.git",
|
2016-01-24 08:01:06 +00:00
|
|
|
:revision => "4239b77079c7b5d1243b7b4736304ce8ddb6f0f2"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/boltdb/bolt" do
|
|
|
|
url "https://github.com/boltdb/bolt.git",
|
2016-01-24 08:01:06 +00:00
|
|
|
:revision => "ee4a0888a9abe7eefe5a0992ca4cb06864839873"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
2015-12-12 16:04:11 +00:00
|
|
|
go_resource "github.com/fsouza/go-dockerclient" do
|
|
|
|
url "https://github.com/fsouza/go-dockerclient.git",
|
2016-01-24 08:01:06 +00:00
|
|
|
:revision => "25bc220b299845ae5489fd19bf89c5278864b050"
|
2015-12-12 16:04:11 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/errwrap" do
|
|
|
|
url "https://github.com/hashicorp/errwrap.git",
|
|
|
|
:revision => "7554cd9344cec97297fa6649b055a8c98c2a1e55"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/go-checkpoint" do
|
|
|
|
url "https://github.com/hashicorp/go-checkpoint.git",
|
2015-12-12 16:04:11 +00:00
|
|
|
:revision => "e4b2dc34c0f698ee04750bf2035d8b9384233e1b"
|
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/go-cleanhttp" do
|
|
|
|
url "https://github.com/hashicorp/go-cleanhttp.git",
|
2016-01-10 21:32:22 +00:00
|
|
|
:revision => "ce617e79981a8fff618bb643d155133a8f38db96"
|
2015-12-12 16:04:11 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/go-immutable-radix" do
|
|
|
|
url "https://github.com/hashicorp/go-immutable-radix.git",
|
2016-01-10 21:32:22 +00:00
|
|
|
:revision => "12e90058b2897552deea141eff51bb7a07a09e63"
|
2015-12-12 16:04:11 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/go-memdb" do
|
|
|
|
url "https://github.com/hashicorp/go-memdb.git",
|
2016-01-10 21:32:22 +00:00
|
|
|
:revision => "31949d523ade8a236956c6f1761e9dcf902d1638"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/go-msgpack" do
|
|
|
|
url "https://github.com/hashicorp/go-msgpack.git",
|
|
|
|
:revision => "fa3f63826f7c23912c15263591e65d54d080b458"
|
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/go-multierror" do
|
|
|
|
url "https://github.com/hashicorp/go-multierror.git",
|
2015-12-12 16:04:11 +00:00
|
|
|
:revision => "d30f09973e19c1dfcd120b2d9c4f168e68d6b5d5"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/go-syslog" do
|
|
|
|
url "https://github.com/hashicorp/go-syslog.git",
|
|
|
|
:revision => "42a2b573b664dbf281bd48c3cc12c086b17a39ba"
|
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/golang-lru" do
|
|
|
|
url "https://github.com/hashicorp/golang-lru.git",
|
2016-01-10 21:32:22 +00:00
|
|
|
:revision => "5c7531c003d8bf158b0fe5063649a2f41a822146"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/hcl" do
|
|
|
|
url "https://github.com/hashicorp/hcl.git",
|
2016-01-24 08:01:06 +00:00
|
|
|
:revision => "578dd9746824a54637686b51a41bad457a56bcef"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/logutils" do
|
|
|
|
url "https://github.com/hashicorp/logutils.git",
|
|
|
|
:revision => "0dc08b1671f34c4250ce212759ebd880f743d883"
|
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/memberlist" do
|
|
|
|
url "https://github.com/hashicorp/memberlist.git",
|
2016-01-10 21:32:22 +00:00
|
|
|
:revision => "9888dc523910e5d22c5be4f6e34520943df21809"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/net-rpc-msgpackrpc" do
|
|
|
|
url "https://github.com/hashicorp/net-rpc-msgpackrpc.git",
|
2015-12-12 16:04:11 +00:00
|
|
|
:revision => "a14192a58a694c123d8fe5481d4a4727d6ae82f3"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/raft" do
|
|
|
|
url "https://github.com/hashicorp/raft.git",
|
2016-01-24 08:01:06 +00:00
|
|
|
:revision => "057b893fd996696719e98b6c44649ea14968c811"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/raft-boltdb" do
|
|
|
|
url "https://github.com/hashicorp/raft-boltdb.git",
|
|
|
|
:revision => "d1e82c1ec3f15ee991f7cc7ffd5b67ff6f5bbaee"
|
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/scada-client" do
|
|
|
|
url "https://github.com/hashicorp/scada-client.git",
|
2015-12-12 16:04:11 +00:00
|
|
|
:revision => "84989fd23ad4cc0e7ad44d6a871fd793eb9beb0a"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/serf" do
|
|
|
|
url "https://github.com/hashicorp/serf.git",
|
2016-01-24 08:01:06 +00:00
|
|
|
:revision => "64d10e9428bd70dbcd831ad087573b66731c014b"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/hashicorp/yamux" do
|
|
|
|
url "https://github.com/hashicorp/yamux.git",
|
2015-12-12 16:04:11 +00:00
|
|
|
:revision => "df949784da9ed028ee76df44652e42d37a09d7e4"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/inconshreveable/muxado" do
|
|
|
|
url "https://github.com/inconshreveable/muxado.git",
|
|
|
|
:revision => "f693c7e88ba316d1a0ae3e205e22a01aa3ec2848"
|
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/miekg/dns" do
|
|
|
|
url "https://github.com/miekg/dns.git",
|
2016-01-24 08:01:06 +00:00
|
|
|
:revision => "c144371d31e35dc0588755ada496462c102c90a6"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/mitchellh/cli" do
|
|
|
|
url "https://github.com/mitchellh/cli.git",
|
2016-01-10 21:32:22 +00:00
|
|
|
:revision => "cb6853d606ea4a12a15ac83cc43503df99fd28fb"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/mitchellh/mapstructure" do
|
|
|
|
url "https://github.com/mitchellh/mapstructure.git",
|
2015-12-12 16:04:11 +00:00
|
|
|
:revision => "281073eb9eb092240d33ef253c404f1cca550309"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/ryanuber/columnize" do
|
|
|
|
url "https://github.com/ryanuber/columnize.git",
|
2015-12-12 16:04:11 +00:00
|
|
|
:revision => "983d3a5fab1bf04d1b412465d2d9f8430e2e917e"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "golang.org/x/crypto" do
|
|
|
|
url "https://go.googlesource.com/crypto.git",
|
2016-01-24 08:01:06 +00:00
|
|
|
:revision => "3760e016850398b85094c4c99e955b8c3dea5711"
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
2015-09-01 17:51:42 +00:00
|
|
|
resource "web-ui" do
|
2016-01-24 08:01:06 +00:00
|
|
|
url "https://releases.hashicorp.com/consul/0.6.3/consul_0.6.3_web_ui.zip"
|
|
|
|
sha256 "93bbb300cacfe8de90fb3bd5ede7d37ae6ce014898edc520b9c96a676b2bbb72"
|
2015-09-01 17:51:42 +00:00
|
|
|
end
|
|
|
|
|
2015-07-12 17:17:18 +00:00
|
|
|
def install
|
2015-12-12 16:04:11 +00:00
|
|
|
contents = Dir["{*,.git,.gitignore}"]
|
|
|
|
gopath = buildpath/"gopath"
|
|
|
|
(gopath/"src/github.com/hashicorp/consul").install contents
|
2015-07-12 17:17:18 +00:00
|
|
|
|
2015-12-12 16:04:11 +00:00
|
|
|
ENV["GOPATH"] = gopath
|
|
|
|
ENV.prepend_create_path "PATH", gopath/"bin"
|
2015-07-12 17:17:18 +00:00
|
|
|
|
2015-12-12 16:04:11 +00:00
|
|
|
Language::Go.stage_deps resources, gopath/"src"
|
2015-07-12 17:17:18 +00:00
|
|
|
|
2015-12-12 16:04:11 +00:00
|
|
|
cd gopath/"src/github.com/hashicorp/consul" do
|
2015-07-12 17:17:18 +00:00
|
|
|
system "make"
|
|
|
|
bin.install "bin/consul"
|
|
|
|
end
|
2015-09-01 17:51:42 +00:00
|
|
|
|
|
|
|
# install web-ui to package share folder.
|
|
|
|
(pkgshare/"web-ui").install resource("web-ui") if build.with? "web-ui"
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
If consul was built with --with-web-ui, you can activate the UI by running
|
|
|
|
consul with `-ui-dir #{pkgshare}/web-ui`.
|
|
|
|
EOS
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
fork do
|
2015-07-21 06:14:42 +00:00
|
|
|
exec "#{bin}/consul", "agent", "-data-dir", "."
|
2015-07-12 17:17:18 +00:00
|
|
|
end
|
|
|
|
sleep 3
|
|
|
|
system "#{bin}/consul", "leave"
|
|
|
|
end
|
|
|
|
end
|