homebrew-core/Formula/metabase.rb

51 lines
1.2 KiB
Ruby

class Metabase < Formula
desc "Business intelligence report server"
homepage "https://www.metabase.com/"
url "https://downloads.metabase.com/v0.44.6/metabase.jar"
sha256 "6b44d59b54d4fa95be2051bd9ba1b872deb8ba3605624cfdb69027eee75ff81c"
license "AGPL-3.0-only"
livecheck do
url "https://www.metabase.com/start/oss/jar.html"
regex(%r{href=.*?/v?(\d+(?:\.\d+)+)/metabase\.jar}i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "37bcd6c4cb9a78ce12024784f598696688b0a4f5930a25f41ab38825273482c3"
end
head do
url "https://github.com/metabase/metabase.git"
depends_on "leiningen" => :build
depends_on "node" => :build
depends_on "yarn" => :build
end
depends_on "openjdk"
def install
if build.head?
system "./bin/build"
libexec.install "target/uberjar/metabase.jar"
else
libexec.install "metabase.jar"
end
bin.write_jar_script libexec/"metabase.jar", "metabase"
end
plist_options startup: true
service do
run opt_bin/"metabase"
keep_alive true
working_dir var/"metabase"
log_path var/"metabase/server.log"
error_log_path "/dev/null"
end
test do
system bin/"metabase", "migrate", "up"
end
end