homebrew-core/Formula/metabase.rb

53 lines
1.3 KiB
Ruby

class Metabase < Formula
desc "Business intelligence report server"
homepage "https://www.metabase.com/"
url "https://downloads.metabase.com/v0.41.6/metabase.jar"
sha256 "9aa2e8429a39d4ef1fa3e304ce67c85e115392352e6fd35ce279872a087e7108"
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: "25ef7b5cded9d0ad630d6e5872c41b5bdcf90392e8893e043f74b964cf6056df"
end
head do
url "https://github.com/metabase/metabase.git"
depends_on "leiningen" => :build
depends_on "node" => :build
depends_on "yarn" => :build
end
# metabase uses jdk.nashorn.api.scripting.JSObject
# which is removed in Java 15
depends_on "openjdk@11"
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", java_version: "11"
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