From a8816f66ff02997f6009493c1a9e2e77f9fdc767 Mon Sep 17 00:00:00 2001 From: Justin Reagor Date: Sat, 13 Feb 2016 15:41:29 -0500 Subject: [PATCH 1/3] Updating README for latest installation process findings --- README.md | 80 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 690087c..4136042 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# xcode-vm +# xcode-vm # This project was started in order to automate the builds of iOS and OS X apps natively using Xcode but within a portable development VM. @@ -31,12 +31,14 @@ would make the ghost of Steve Jobs very sad. [1]: https://github.com/boxcutter/osx -## Requirements +## Requirements ## * Homebrew * w/ Brewfile support `brew tap homebrew/bundle` -## Setup +## Setup ## + +### Clone this Project Start by cloning this project, note the use of `--recursive` for cloning git submodules as well. @@ -44,37 +46,55 @@ submodules as well. $ git clone --recursive https://github.com/cheapRoc/xcode-vm $ cd xcode-vm +### Install Homebrew + Install our local dependencies (because you have Homebrew preinstalled). $ brew tap homebrew/bundle $ brew bundle +### Download OS X + Make sure you've downloaded a copy of the OS X v10.11 El Capitan installation media (huge app containing the OS X disk image). - Download OS X from the App Store - It'll end up in `/Applications/Install OS X El Capitan.app` -Next, we'll clone `boxcutter/osx` off of GitHub in order to help us turn our OS -X installation media into a Vagrant base box. +### Clone boxcutter/osx + +Unless you have an `./osx` directory with files, clone `boxcutter/osx` off of +GitHub. This performs all of the work in turning your OS X installation media +into a proper Vagrant base box. $ git clone https://github.com/boxcutter/osx $ cd osx +### Prepare the OS X Media + From the instructions in `boxcutter/osx` we'll need to prepare the DMG as a patched ISO. +This script performs a bunch of helpful things like removing all of the OS X +installation steps, configuring post-install hooks, and setting up accounts. + $ sudo ./prepare_iso/prepare_iso.sh -D DISABLE_REMOTE_MANAGEMENT /Applications/Install\ OS\ X\ El\ Capitan.app dmg +### Pack OS X into a Box + Next, we'll use Packer to automate the generation of our Vagrant base image/box. $ packer build -only=virtualbox-iso -var-file=osx1011.json osx.json -Then add this base box to Vagrant, taking note of the name of our base -`osx1011`. +### Add OS X to Vagrant + +Now we'll add our newly minted base box into Vagrant. Take note of the name +we've given the box, `osx1011`. $ vagrant box add ./box/virtualbox/osx1011-nocm-0.1.0.box --name osx1011 +### Configure a Vagrantfile + Next, create your own `Vagrantfile` via `vagrant init`, or copy our `Vagrantfile` as your template. @@ -82,4 +102,48 @@ Vagrant machines running OS X will need extra resources in order to run. You'll probably want to mess around with VirtualBox settings until you've found the right set of resources for your virtualization host environment. -**WARNING:** This ain't done. +### Vagrant Up + +Now `vagrant up` and `vagrant ssh` in order to log in. + +If things worked out and you've SSH'd into your OS X VM, you can `vagrant halt` +for now. + +### Download Xcode + +Next we'll download Xcode. + +Like OS X, you'll need to manually download Xcode from Apple. + +Unlike OS X, we won't need the App Store if you've got an Apple Developer +account. + +Click the following link to download the installation disk image. You'll be +prompted to log into your Apple Developer account first. + +- [Download Xcode 7.2.1](https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_7.2.1/Xcode_7.2.1.dmg) + +### Copy & Mount Xcode + +Copy the downloaded file into our work directory and mount it into the VM's file system. + + $ vagrant halt + $ cp ~/Downloads/Xcode_7.2.1.dmg ./ + $ vagrant up + $ vagrant ssh + $ hdiutil attach -nobrowse /vagrant/Xcode_7.2.1.dmg + $ ls -la /Volumes/Xcode + +If everything worked, you should have listed the newly mounted directory +`/Volumes/Xcode`. This includes the Xcode installation files. + +### Install Xcode + +Next, we'll perform a headless install of Xcode and Xcode Server. + +**WARNING:** This ain't done... + +## ...but we're close! + +So far, I've proven out that you can at least install Xcode Server and run it's +wrapped services (CouchDB, Nginx, Redis). From f6887f88f0d9669226167253d1dbd81bb4ff3db5 Mon Sep 17 00:00:00 2001 From: Justin Reagor Date: Sat, 13 Feb 2016 15:56:44 -0500 Subject: [PATCH 2/3] More README.md work in progress --- README.md | 55 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 4136042..cbcc539 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ Things left to script... * Utilization for processing CD/CI jobs. You'll need to use your personal, licensed copy of OS X in order to build this -VM. Everything else will be automatically installed for you (or will be in -time). +VM. We'll also walk you through downloading Xcode for your VM. Everything else +should be automatically installed for you. This setup works with Vagrant since [boxcutter/osx][1] provides a well supported process and Packer template. Hopefully in the future we'll get the time to test @@ -36,9 +36,9 @@ would make the ghost of Steve Jobs very sad. * Homebrew * w/ Brewfile support `brew tap homebrew/bundle` -## Setup ## +## Process ## -### Clone this Project +### Clone Project Start by cloning this project, note the use of `--recursive` for cloning git submodules as well. @@ -70,7 +70,7 @@ into a proper Vagrant base box. $ git clone https://github.com/boxcutter/osx $ cd osx -### Prepare the OS X Media +### Prepare OS X Media From the instructions in `boxcutter/osx` we'll need to prepare the DMG as a patched ISO. @@ -80,20 +80,20 @@ installation steps, configuring post-install hooks, and setting up accounts. $ sudo ./prepare_iso/prepare_iso.sh -D DISABLE_REMOTE_MANAGEMENT /Applications/Install\ OS\ X\ El\ Capitan.app dmg -### Pack OS X into a Box +### Pack Base Box Next, we'll use Packer to automate the generation of our Vagrant base image/box. $ packer build -only=virtualbox-iso -var-file=osx1011.json osx.json -### Add OS X to Vagrant +### Add to Vagrant Now we'll add our newly minted base box into Vagrant. Take note of the name we've given the box, `osx1011`. $ vagrant box add ./box/virtualbox/osx1011-nocm-0.1.0.box --name osx1011 -### Configure a Vagrantfile +### Vagrantfile Next, create your own `Vagrantfile` via `vagrant init`, or copy our `Vagrantfile` as your template. @@ -102,7 +102,7 @@ Vagrant machines running OS X will need extra resources in order to run. You'll probably want to mess around with VirtualBox settings until you've found the right set of resources for your virtualization host environment. -### Vagrant Up +### Run VM Now `vagrant up` and `vagrant ssh` in order to log in. @@ -111,19 +111,14 @@ for now. ### Download Xcode -Next we'll download Xcode. - -Like OS X, you'll need to manually download Xcode from Apple. - -Unlike OS X, we won't need the App Store if you've got an Apple Developer -account. - -Click the following link to download the installation disk image. You'll be -prompted to log into your Apple Developer account first. +Next, you'll need to manually download Xcode from Apple. If you've got an Apple +Developer account you can visit the link below. Click the following link and +you'll be prompted to log into your Apple Developer account to begin the +download. - [Download Xcode 7.2.1](https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_7.2.1/Xcode_7.2.1.dmg) -### Copy & Mount Xcode +### Install Xcode Copy the downloaded file into our work directory and mount it into the VM's file system. @@ -132,18 +127,28 @@ Copy the downloaded file into our work directory and mount it into the VM's file $ vagrant up $ vagrant ssh $ hdiutil attach -nobrowse /vagrant/Xcode_7.2.1.dmg - $ ls -la /Volumes/Xcode + $ cp -R /Volumes/Xcode/Xcode.app /Applications/Xcode.app + $ hdiutil detach /Volumes/Xcode -If everything worked, you should have listed the newly mounted directory -`/Volumes/Xcode`. This includes the Xcode installation files. +If everything worked, you should have Xcode installed at the normal +`/Applications/Xcode.app`. -### Install Xcode +### Install Xcode Server + +Next, we'll perform a headless install of Xcode Server. This is just slightly +tricky and hacking to find the simplest way possible is on-going. + +For now, just run the following to boot everything up... -Next, we'll perform a headless install of Xcode and Xcode Server. + $ /Applications/Xcode.app/Contents/Developer/usr/bin/xcscontrol -initialize **WARNING:** This ain't done... ## ...but we're close! So far, I've proven out that you can at least install Xcode Server and run it's -wrapped services (CouchDB, Nginx, Redis). +wrapped services (CouchDB, Nginx, Redis) without needing OS X Server. Further +experimentation is required to see why OS X is a dependency within Apple's +documentation. The $19.99 dependency may only be "Bonjour support" but even +that's up for debate with the entire Xcode Server tool set now distributed +within Xcode itself. From 782f7eaa42ce08d81a7da3d8c52cc02431cf325e Mon Sep 17 00:00:00 2001 From: Justin Reagor Date: Sat, 13 Feb 2016 16:01:31 -0500 Subject: [PATCH 3/3] Reference amazingly informative 'Xcode Server Hacks' article --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cbcc539..38406f2 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,10 @@ For now, just run the following to boot everything up... So far, I've proven out that you can at least install Xcode Server and run it's wrapped services (CouchDB, Nginx, Redis) without needing OS X Server. Further experimentation is required to see why OS X is a dependency within Apple's -documentation. The $19.99 dependency may only be "Bonjour support" but even +documentation. The $19.99 dependency may only be "Bonjour support" but even that's up for debate with the entire Xcode Server tool set now distributed -within Xcode itself. +within Xcode itself. + +BTW, [Xcode Server Hacks](https://honzadvorsky.com/articles/2015-05-04-under-the-hood-of-xcode-server/) by [@czechboy0](https://twitter.com/czechboy0) is insanely handy... + +Yup, looks like [OS X Server is not a requirement](https://honzadvorsky.com/articles/2015-08-12-xcode_server_hacks_cli_xcscontrol/).