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.43.4/metabase.jar"
sha256 "c89644d013eced830fc02d1169b88708fc2105089b356f1c988875b05882c189"
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: "62f316ceb0b26acafdca76732fc5185eb8b404ca3d31a2860ee47df2cfad4e31"
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