2014-09-21 14:17:54 +00:00
|
|
|
class Artifactory < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Manages binaries"
|
2014-11-08 06:20:22 +00:00
|
|
|
homepage "http://www.jfrog.com/artifactory/"
|
2015-08-22 17:40:08 +00:00
|
|
|
url "https://dl.bintray.com/jfrog/artifactory/jfrog-artifactory-oss-4.0.2.zip"
|
|
|
|
sha256 "52a882b3681bc00eb73fddfe6abdc739156c2940be073406185be23a5f35bff2"
|
2014-09-21 14:17:54 +00:00
|
|
|
|
2015-08-04 02:17:11 +00:00
|
|
|
depends_on :java => "1.8+"
|
2014-09-21 14:17:54 +00:00
|
|
|
|
2014-11-08 06:20:22 +00:00
|
|
|
option "with-low-heap", "Run artifactory with low Java memory options. Useful for development machines. Do not use in production."
|
2014-09-21 14:17:54 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
# Remove Windows binaries
|
2014-11-08 06:20:22 +00:00
|
|
|
rm_f Dir["bin/*.bat"]
|
|
|
|
rm_f Dir["bin/*.exe"]
|
2014-09-21 14:17:54 +00:00
|
|
|
|
|
|
|
# Set correct working directory
|
2014-11-08 06:20:22 +00:00
|
|
|
inreplace "bin/artifactory.sh",
|
2014-09-21 14:17:54 +00:00
|
|
|
'export ARTIFACTORY_HOME="$(cd "$(dirname "${artBinDir}")" && pwd)"',
|
|
|
|
"export ARTIFACTORY_HOME=#{libexec}"
|
|
|
|
|
|
|
|
# Reduce memory consumption for non production use
|
2014-11-08 06:20:22 +00:00
|
|
|
inreplace "bin/artifactory.default",
|
|
|
|
"-server -Xms512m -Xmx2g",
|
|
|
|
"-Xms128m -Xmx768m" if build.with? "low-heap"
|
2014-09-21 14:17:54 +00:00
|
|
|
|
2014-11-08 06:20:22 +00:00
|
|
|
libexec.install Dir["*"]
|
2014-09-21 14:17:54 +00:00
|
|
|
|
|
|
|
# Launch Script
|
2014-11-08 06:20:22 +00:00
|
|
|
bin.install_symlink libexec/"bin/artifactory.sh"
|
2014-09-21 14:17:54 +00:00
|
|
|
# Memory Options
|
2014-11-08 06:20:22 +00:00
|
|
|
bin.install_symlink libexec/"bin/artifactory.default"
|
2014-09-21 14:17:54 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def post_install
|
|
|
|
# Create persistent data directory. Artifactory heavily relies on the data
|
|
|
|
# directory being directly under ARTIFACTORY_HOME.
|
2015-02-01 12:29:08 +00:00
|
|
|
# Therefore, we symlink the data dir to var.
|
|
|
|
data = var/"artifactory"
|
2014-09-21 14:17:54 +00:00
|
|
|
data.mkpath
|
|
|
|
|
2014-11-08 06:20:22 +00:00
|
|
|
libexec.install_symlink data => "data"
|
2014-09-21 14:17:54 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
plist_options :manual => "#{HOMEBREW_PREFIX}/opt/artifactory/libexec/bin/artifactory.sh"
|
|
|
|
|
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>com.jfrog.artifactory</string>
|
|
|
|
|
|
|
|
<key>WorkingDirectory</key>
|
|
|
|
<string>#{libexec}</string>
|
|
|
|
|
|
|
|
<key>Program</key>
|
|
|
|
<string>bin/artifactory.sh</string>
|
|
|
|
|
|
|
|
<key>KeepAlive</key>
|
|
|
|
<true/>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-08-22 18:37:27 +00:00
|
|
|
assert_match /Checking arguments to Artifactory/, pipe_output("#{bin}/artifactory.sh check")
|
2014-09-21 14:17:54 +00:00
|
|
|
end
|
|
|
|
end
|