homebrew-core/Formula/jenkins.rb
2015-04-08 15:28:12 +08:00

59 lines
1.8 KiB
Ruby

class Jenkins < Formula
homepage "https://jenkins-ci.org"
url "http://mirrors.jenkins-ci.org/war/1.608/jenkins.war"
sha1 "aeb04ef2fc91e176d04e9e7eca53c6b4082e77f7"
bottle do
sha256 "106ee16ec814edb28450b0e184b8dfad8c567be1209aeda6905ca87b7560043c" => :yosemite
sha256 "68f21ead2567fc7ff997bd930ceddaa2520a46704968c6489ae9a4ad90718cb0" => :mavericks
sha256 "30d395d88b191c1a416c424bfd6982aca8b16414f3df29ca12fbe695b587f62e" => :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