homebrew-core/Formula/jenkins.rb
2015-03-16 13:04:34 +08:00

59 lines
1.8 KiB
Ruby

class Jenkins < Formula
homepage "https://jenkins-ci.org"
url "http://mirrors.jenkins-ci.org/war/1.604/jenkins.war"
sha1 "cce45f3b9a38c9d02c59bceeeb05a70d52d65f75"
bottle do
sha256 "35f80586cead8dc95ef1610e808661e8c5be763ac428d6f3fc0ede00affafbd6" => :yosemite
sha256 "34c5a47e6b702a3d686b1ab12b959dd868415f6e58b7ea91ce99fc4d04b55af2" => :mavericks
sha256 "fc930cbe26e1ab1e2111c6e6ffd5c6d25aef1b469336cbdb6d927d54f4e999bb" => :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