Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Formula/vitess.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
class Vitess < Formula
desc "Database clustering system for horizontal scaling of MySQL"
homepage "https://vitess.io"
url "https://github.com/vitessio/vitess/archive/v9.0.0.tar.gz"
sha256 "14254f423f2472fb48034299cbfc4acc6b767f7497036cf43eb3e7f2a70f7beb"
license "Apache-2.0"

depends_on "go" => :build
depends_on "etcd"

def install
system "make", "install-local", "PREFIX=#{prefix}", "VTROOT=#{buildpath}"
pkgshare.install "examples"
end

test do
etcd_server = "localhost:#{free_port}"
fork do
exec Formula["etcd"].opt_bin/"etcd", "--enable-v2=true",
"--data-dir=#{testpath}/etcd",
"--listen-client-urls=http://#{etcd_server}",
"--advertise-client-urls=http://#{etcd_server}"
end
sleep 3

port = free_port
fork do
exec bin/"vtgate", "-topo_implementation", "etcd2",
"-topo_global_server_address", etcd_server,
"-topo_global_root", testpath/"global",
"-port", port.to_s
end
sleep 3

output = shell_output("curl -s localhost:#{port}/debug/health")
assert_equal "ok", output
end
end