├── Jenkins.sh ├── README.md ├── accept_homebrew.exp └── accept_xcode_license.exp /Jenkins.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Xcode 4 | 5 | echo "Installing Xcode Command Line Tools" 6 | hdiutil mount -noverify xcode_cli.dmg 7 | echo $1 | sudo -S installer -package "/Volumes/Command Line Tools (Mountain Lion)/Command Line Tools (Mountain Lion).mpkg" -target / 8 | umount "/Volumes/Command Line Tools (Mountain Lion)" 9 | 10 | echo "Installing Xcode" 11 | hdiutil mount -noverify xcode.dmg 12 | echo $1 | sudo -S cp -R "/Volumes/Xcode/Xcode.app" /Applications 13 | umount "/Volumes/Xcode" 14 | 15 | echo "Enabling Mac Developer Mode" 16 | echo $1 | sudo -S /usr/sbin/DevToolsSecurity -enable 17 | echo $1 | /usr/sbin/dseditgroup -o edit -t group -a staff _developer 18 | 19 | expect "accept_xcode_license.exp" $1 20 | 21 | # Homebrew, git, cocoapods, node 22 | 23 | echo "Installing Homebrew" 24 | curl -O https://raw.github.com/mxcl/homebrew/go 25 | expect "accept_homebrew.exp" $1 "go" 26 | 27 | echo "Installing git" 28 | brew install git 29 | 30 | echo $1 | sudo -S gem update --system 31 | echo "Installing cocoapods" 32 | echo $1 | sudo -S gem install cocoapods 33 | pod setup 34 | 35 | echo "Installing node" 36 | brew install node 37 | 38 | # Eclipse 39 | 40 | echo "Installing Eclipse" 41 | tar -zxf eclipse.tar 42 | mv Eclipse /Applications/Eclipse 43 | 44 | # Java 45 | 46 | echo "Installing JDK" 47 | hdiutil mount -noverify jdk.dmg 48 | echo $1 | sudo -S installer -package "/Volumes/JDK 7 Update 15/JDK 7 Update 15.pkg" -target / 49 | umount "/Volumes/JDK 7 Update 15" 50 | 51 | echo "Installing Java 6" 52 | hdiutil mount -noverify jre6.dmg 53 | echo $1 | sudo -S installer -package "/Volumes/Java for OS X 2013-001/JavaForOSX.pkg" -target / 54 | umount "/Volumes/Java for OS X 2013-001" 55 | 56 | echo "Installing Java 7" 57 | hdiutil mount -noverify jre7.dmg 58 | echo $1 | sudo -S installer -package "/Volumes/Java 7 Update 15/Java 7 Update 15.pkg" -target / 59 | umount "/Volumes/Java 7 Update 15" 60 | 61 | # Jenkins + Tools 62 | 63 | echo "Downloading Latest Version of Jenkins" 64 | cd ~/Downloads 65 | curl -L -o jenkins.pkg http://mirrors.jenkins-ci.org/osx/latest 66 | echo "Installing Jenkins" 67 | echo $1 | sudo -S installer -pkg jenkins.pkg -target / 68 | 69 | sleep 20 # wait for Jenkins to boot up 70 | 71 | echo "Downloading Jenkins CLI" 72 | curl -L -O http://localhost:8080/jnlpJars/jenkins-cli.jar 73 | 74 | echo "Installing Jenkins Plugins" 75 | echo "Installing xcode Plugin" 76 | java -jar jenkins-cli.jar -s http://localhost:8080/ install-plugin https://updates.jenkins-ci.org/latest/xcode-plugin.hpi 77 | 78 | echo "Installing git oauth plugin" 79 | java -jar jenkins-cli.jar -s http://localhost:8080/ install-plugin http://updates.jenkins-ci.org/latest/github-oauth.hpi 80 | 81 | echo "Installing build timeout plugin" 82 | java -jar jenkins-cli.jar -s http://localhost:8080/ install-plugin http://updates.jenkins-ci.org/latest/build-timeout.hpi -restart -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jenkins Bootstrap 2 | 3 | ## About 4 | 5 | A shell script that creates an environment suitable for an OS X Jenkins Continuous Integration Server 6 | 7 | ## Features 8 | 9 | * installs Java JDK 7 10 | * installs Java JRE 6 11 | * installs Java JRE 7 12 | * installs xcode and xcode CLI tools 13 | * installs homebrew 14 | * installs cocoapods 15 | * installs git 16 | * installs "oh my zsh" 17 | * installs eclipse 18 | * installs node 19 | * installs Jenkins with GithubOAuth, Xcode, and build timeout plugins 20 | * updates rubygems to the latest possible version 21 | 22 | ## Requirements 23 | 24 | * OSX Mountain Lion 25 | * Xcode 4.6 dmg (named as xcode.dmg) 26 | * Xcode CLI tools dmg (named as xcode_cli.dmg) 27 | * Eclipse 4.2.1 tarball, 64-bit version 28 | * Java JDK 7 Update 15 29 | * An Active Internet Connection 30 | 31 | ## Directions 32 | 33 | 1. clone Jenkins_Bootstrap into a new repo 34 | 2. Ensure Xcode, Xcode CLI, Eclipse Tarball, and Java JDK are in the same folder as Jenkins.sh 35 | 3. run the script with your admin password as a parameter. Eg: `sh Jenkins.sh ` 36 | 4. Sit back, grab yourself a coffee, and wait for everything to install 37 | 38 | ## License 39 | 40 | Jenkins Bootstrap for OSX is released under the [MIT License](http://opensource.org/licenses/MIT). -------------------------------------------------------------------------------- /accept_homebrew.exp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect -f 2 | set timeout 3600 3 | set password [lindex $argv 0] 4 | set rubyLink [lindex $argv 1] 5 | spawn ruby $rubyLink 6 | 7 | expect { 8 | "Press ENTER to continue or any other key to abort" 9 | { 10 | send "\r" 11 | exp_continue 12 | } 13 | "Password" 14 | { 15 | send "$password\r" 16 | exp_continue 17 | } 18 | "incorrect password attempts" 19 | { 20 | exit 1 21 | } 22 | } -------------------------------------------------------------------------------- /accept_xcode_license.exp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect -f 2 | set timeout -1 3 | set password [lindex $argv 0] 4 | spawn sudo xcodebuild -license 5 | 6 | expect { 7 | "Password" 8 | { 9 | #stty -echo 10 | #expect_user -re "(.*)\n" 11 | # stty echo 12 | #set pass $expect_out(1,string) 13 | send "$password\r" 14 | exp_continue 15 | } 16 | "incorrect password attempts" 17 | { 18 | exit 1 19 | } 20 | "Hit the Enter key to view the license agreements" 21 | { 22 | send "\r" 23 | exp_continue 24 | } 25 | "Press 'space' for more" 26 | { 27 | send " " 28 | exp_continue 29 | } 30 | "By typing 'agree'" 31 | { 32 | send "agree\r" 33 | exp_continue 34 | } 35 | } --------------------------------------------------------------------------------