homebrew-core/Formula/jenkins.rb
2015-05-26 14:57:43 +08:00

60 lines
1.8 KiB
Ruby

class Jenkins < Formula
homepage "https://jenkins-ci.org"
url "http://mirrors.jenkins-ci.org/war/1.615/jenkins.war"
sha256 "69b6617a460b4ad22552eab97e6c39312019d668198607dd72a2d0ea63884f40"
bottle do
cellar :any
sha256 "e85b1c7de891d8e1db27811beb9cb4ecd1adaab9b79eff97a8b5d67fe84a150c" => :yosemite
sha256 "ef6734ab3f491465305c9f0af67343e3793fc6242f2af8ec809a89bb12acc1b2" => :mavericks
sha256 "012581ffed23fea6ca94596f6f2bac19816fbf904e357480b8bbaa613dc47876" => :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