homebrew-core/Formula/jenkins.rb

54 lines
1.5 KiB
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class Jenkins < Formula
homepage 'http://jenkins-ci.org'
2012-10-16 09:31:18 +00:00
url 'http://mirrors.jenkins-ci.org/war/1.486/jenkins.war'
sha1 'c33ff88dfe11828623713ce47e3df0f8b441b9aa'
2012-02-14 05:52:14 +00:00
head 'https://github.com/jenkinsci/jenkins.git'
def install
2012-09-03 21:07:27 +00:00
if build.head?
system "mvn clean install -pl war -am -DskipTests"
2012-09-08 19:19:08 +00:00
libexec.install 'war/target/jenkins.war', '.'
else
libexec.install "jenkins.war"
end
end
2012-05-04 03:40:15 +00:00
def caveats; <<-EOS.undent
If this is your first install, automatically load on login with:
mkdir -p ~/Library/LaunchAgents
2012-09-26 13:43:26 +00:00
ln -nfs #{plist_path} ~/Library/LaunchAgents/
2012-05-04 03:40:15 +00:00
launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
2012-05-04 03:40:15 +00:00
If this is an upgrade and you already have the #{plist_path.basename} loaded:
launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename}
launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
2012-05-04 03:40:15 +00:00
Or start it manually:
java -jar #{libexec}/jenkins.war
EOS
end
2012-05-04 03:40:15 +00:00
def startup_plist; <<-EOS
<?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>
2012-05-04 03:40:15 +00:00
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-jar</string>
2012-09-26 13:43:26 +00:00
<string>#{HOMEBREW_PREFIX}/opt/jenkins/libexec/jenkins.war</string>
2012-05-04 03:40:15 +00:00
<string>--httpListenAddress=127.0.0.1</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
end