Wikimedia Apps/Team/iOS/CI/ServerSetup
Access Server
[edit]You will need to access your server, of course. For Wikimedia you can get that information on the Server Access page..Â
For anyone else, you can just access it directly, use SSH, or the Apple Screen Sharing.app
Configure Server
[edit]Once connected to the server, you need to install various tools to enable continuous integration. Most of the following steps can be performed either through screen sharing or ssh.Â
Xcode
[edit]- Install Xcode from App Store (must be done via screen sharing)
- Install the Xcode Command Line Tools by doing one of the following:
- Launch Xcode app, go to the "Downloads" preference pane, and download the command line tools
- Run
xcode-select --install
Upgrading Xcode
[edit]Xcode and Command Line Tools can be installed and upgrade through the App Store when using publicly-available versions. If you need a pre-release version of either, download them directly from the SDK section of Apple's developer website. When you upgrade Xcode or Command Line Tools, the machine will be required to restart. After restart occurs, you need to manually sign back in to the OS (via GUI) restore the Jenkins user session. Once signed in, you'll then need to launch Xcode and accept any new Terms and Conditions in order for builds to run without sudo permissions.
Allow remote connections in OS X
[edit]- Enable Remote Access
- Open the System Preferences > Sharing
- Enable Remote Management
- Enable File Sharing for directories you will need to access.
Note: AFTER installing OS X Server on the build server, you can also install the OS X Server app on your local machine and connect to it remotely over VPN or while on site.
Install Command Line Tools
[edit]The following are used to by the build tools, or used to install build tools.
- Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install Fastlane
gem install fastlane
- Install Cocoapods
gem install cocoapods
(if you use Cocoapods for dependency mangement in your Xcode projects) - Install the any other executables needed to perform your build that aren't provided by the OS
We had problems installing the nokogiri gem on OS X 10.10 Yosemite (required by fastlane), See these Stack Overflow posts for more info:
http://stackoverflow.com/questions/24091869/installing-nokogiri-on-osx-10-10-yosemite
What's currently working on Jenkins is to install libxml et. al using Homebrew, then specify the following options:
--with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib/libxml2
Install Jenkins
[edit]- Install Jenkins via homebrew:
brew install jenkins
- Edit the configuration (Note: If these values donât exist in the file, add them in the Program Arguments array `<key>ProgramArguments</key>`)
- Open the configuration plist in a text editor
~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
- Modify the http listening address to listen on all ports
<string>--httpListenAddress=0.0.0.0</string>
- Modify the port (`8080` is recommended)
<string>--httpPort=8080</string>
- Open the configuration plist in a text editor
- Setup as a launch process by running
ln -sfv /usr/local/opt/jenkins/*.plist ~/Library/LaunchAgents
- Launch Jenkins by running
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
- Test by opening http://localhost:8080/ in your browser.
- HAX: (BG) I had to use EnvInject to set some environment variables, even though they're set in the user's shell. There's currently a stale Jenkins bug on this topic, but current hard-coded values are as follows:
HOME
:/Users/jenkins
PATH
:/usr/local/bin
TERM
:xterm-256color
BUNDLE_BUILD_NOKOGIRI
:--use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib/libxml2
BUNDLE_PATH
:vendor/bundle
- HAX: (BG) If a build is hanging for unclear reasons, VNC/Screenshare to the machine and ensure that the hanging process isn't visually prompting the user for access to the keychain. This might be mitigated by unlocking the keychain manually before jobs start executing.
Setup a Project
[edit]After you complete the above steps you are ready to configure your project for continuous integration.