Skip to content

Instantly share code, notes, and snippets.

@rhodrid
Created August 1, 2018 10:57
Show Gist options
  • Save rhodrid/7ba81fba3a1f8fa0c809154cc0cdef8c to your computer and use it in GitHub Desktop.
Save rhodrid/7ba81fba3a1f8fa0c809154cc0cdef8c to your computer and use it in GitHub Desktop.
MacOS: Run Jenkins Slave as a Service
<?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>com.jenkins.ci</string>
<key>UserName</key>
<string>jenkins</string>
<key>SessionCreate</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>java</string>
<string>-Djava.awt.headless=true</string>
<string>-jar</string>
<string>/Users/jenkins/Desktop/slave.jar</string>
<string>-jnlpUrl</string>
<string>http://192.168.1.151:8080/computer/mac_vm/slave-agent.jnlp</string>
</array>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/Users/jenkins/Desktop/stdout.log</string>
<key>StandardErrorPath</key>
<string>/Users/jenkins/Desktop/error.log</string>
</dict>
</plist>
cp com.jenkins.ci.plist /Library/LaunchDaemons
sudo chown root /Library/LaunchDaemons/com.jenkins.ci.plist
sudo chmod 644 /Library/LaunchDaemons/com.jenkins.ci.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment