Created
October 14, 2012 21:18
-
-
Save nicerobot/3889839 to your computer and use it in GitHub Desktop.
Create Jenkins group/user on Mac OS X
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# curl -Lks https://raw.github.com/gist/3889839/jenkins.sh | sudo sh -s | |
# from http://mattonrails.wordpress.com/2011/06/08/jenkins-homebrew-mac-daemo/ | |
# open http://localhost:8080 | |
brew list jenkins || brew install jenkins | |
mkdir /var/jenkins | |
/usr/sbin/dseditgroup -o create -r 'Jenkins CI Group' -i 600 _jenkins | |
dscl . -append /Groups/_jenkins passwd "*" | |
dscl . -create /Users/_jenkins | |
dscl . -append /Users/_jenkins RecordName jenkins | |
dscl . -append /Users/_jenkins RealName "Jenkins CI Server" | |
dscl . -append /Users/_jenkins uid 600 | |
dscl . -append /Users/_jenkins gid 600 | |
dscl . -append /Users/_jenkins shell /usr/bin/false | |
dscl . -append /Users/_jenkins home /var/jenkins | |
dscl . -append /Users/_jenkins passwd "*" | |
dscl . -append /Groups/_jenkins GroupMembership _jenkins | |
chown -R jenkins /var/jenkins | |
( | |
cd /Library/LaunchDaemons/ | |
curl -Lks -o org.jenkins-ci.plist https://raw.github.com/gist/3889839/org.jenkins-ci.plist | |
WAR_PATH=$(brew list jenkins | grep '[.]war') | |
perl -pi -e "s|WAR_PATH|${WAR_PATH}|" org.jenkins-ci.plist | |
chown -R root org.jenkins-ci.plist | |
launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist | |
) | |
sudo -u jenkins ssh-keygen </dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>Jenkins</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/java</string> | |
<string>-jar</string> | |
<string>WAR_PATH</string> | |
</array> | |
<key>OnDemand</key> | |
<false/> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>UserName</key> | |
<string>jenkins</string> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment