homebrew-core/Formula/questdb.rb

44 lines
1.2 KiB
Ruby

class Questdb < Formula
desc "Time Series Database"
homepage "https://questdb.io"
url "https://github.com/questdb/questdb/releases/download/6.4.3/questdb-6.4.3-no-jre-bin.tar.gz"
sha256 "61be6ef8002c48a8cfb004cec7ff0cb2bd8f91dcc80343a9483643893ac0df7c"
license "Apache-2.0"
bottle do
sha256 cellar: :any_skip_relocation, all: "b28b1aa2d4c0fe6750e23031d29891b5157f9784e2e225e45e8e30c4b42dbede"
end
depends_on "openjdk@11"
def install
rm_rf "questdb.exe"
libexec.install Dir["*"]
(bin/"questdb").write_env_script libexec/"questdb.sh", Language::Java.overridable_java_home_env("11")
inreplace libexec/"questdb.sh", "/usr/local/var/questdb", var/"questdb"
end
service do
run [opt_bin/"questdb", "start", "-d", var/"questdb", "-n", "-f"]
keep_alive successful_exit: false
error_log_path var/"log/questdb.log"
log_path var/"log/questdb.log"
working_dir var/"questdb"
end
test do
mkdir_p testpath/"data"
begin
fork do
exec "#{bin}/questdb start -d #{testpath}/data"
end
sleep 30
output = shell_output("curl -Is localhost:9000/index.html")
sleep 4
assert_match "questDB", output
ensure
system "#{bin}/questdb", "stop"
end
end
end