60 lines
1.8 KiB
Ruby
60 lines
1.8 KiB
Ruby
class Jenkins < Formula
|
|
homepage "https://jenkins-ci.org"
|
|
url "http://mirrors.jenkins-ci.org/war/1.610/jenkins.war"
|
|
sha256 "bb5a7b29e359a3743ddf385975bca65221cee89b0a13c5309169601d23952e0e"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "34444be233ce551b222d52c19e45fcac844d509b78016073a0d4a1f0056f3c31" => :yosemite
|
|
sha256 "9b50c516ac802b9acd43eeb6431d1a427cbc49bfeb3f7c9d71921ee150c4997e" => :mavericks
|
|
sha256 "47f98740c072681996b081826e2770cc2d6288f5dabcea7a991c03097a4e6866" => :mountain_lion
|
|
end
|
|
|
|
head do
|
|
url "https://github.com/jenkinsci/jenkins.git"
|
|
depends_on "maven" => :build
|
|
end
|
|
|
|
depends_on :java => "1.6+"
|
|
|
|
def install
|
|
if build.head?
|
|
system "mvn", "clean", "install", "-pl", "war", "-am", "-DskipTests"
|
|
else
|
|
system "jar", "xvf", "jenkins.war"
|
|
end
|
|
libexec.install Dir["**/jenkins.war", "**/jenkins-cli.jar"]
|
|
bin.write_jar_script libexec/"jenkins.war", "jenkins"
|
|
bin.write_jar_script libexec/"jenkins-cli.jar", "jenkins-cli"
|
|
end
|
|
|
|
plist_options :manual => "jenkins"
|
|
|
|
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>#{plist_name}</string>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>/usr/bin/java</string>
|
|
<string>-Dmail.smtp.starttls.enable=true</string>
|
|
<string>-jar</string>
|
|
<string>#{opt_libexec}/jenkins.war</string>
|
|
<string>--httpListenAddress=127.0.0.1</string>
|
|
<string>--httpPort=8080</string>
|
|
</array>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
def caveats; <<-EOS.undent
|
|
Note: When using launchctl the port will be 8080.
|
|
EOS
|
|
end
|
|
end
|