These instructions focus on performing Automation commands for our Node.js applications. Additional work is required to run the applications, and further work to run our Rails applications.
Download and install the Xcode Command Line tools: https://docs.google.com/a/tstmedia.com/file/d/0B8_iK4kgomHFWFpQdm5PQ1lQZ0U
This (along with the full Xcode.dmg) can be found on the dev drive as well
We use RVM to manage the different versions of Ruby that our applications use. We use Homebrew to install additional tools (like Git) easily. Perform the following steps in the Terminal (/Applications/Utilities/Terminal).
- Install Homebrew with the following command:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
- Install some development dependencies with the newly installed Homebrew:
brew install git
- To learn more about Git, feel free to check out Git for Normals and Enhanced Ass-Kicking with Git, two presentations I've made for the Sport Ngin developers.
- Install RVM with the following command:
curl -L https://get.rvm.io | bash -s stable
- Tell RVM to use Homebrew to install any missing dependencies:
rvm autolibs brew
. - Install Node.js:
brew install node
- Install Grunt (a Node.js tool to perform tasks in your project) with the
command:
npm install -g grunt-cli
- Close your Teriminal window and open a new one. This will ensure that the settings changes from the above steps take effect.
Before closing a repository from GitHub with SSH, you must set up an SSH key to authenticate your computer with their servers. This only needs to be done once. To confirm whether you have to perform this step, try this command: ssh [email protected]
. If you see a message similar to "Hi pbyrne! You've successfully authenticated" then you do not need to perform this step, as it's already been done.
- Generate a new SSH key with
ssh-keygen
and follow the prompts.- When prompted to supply a name for the new key, use the default name ("id_rsa") by pressing Enter without typing anything, unless you have a good reason to give it a different name.
- Copy the contents of the newly generated public key with the following command:
pbcopy < ~/.ssh/id_rsa.pub
- Browse to GitHub's SSH settings page and click the Add Key button.
- Give the new key a descriptive name ("Sport Ngin laptop SSH key") and paste the contents of the public key into the space provided.
- Fetch the URL to clone a repository from the project's page on GitHub.
- Create a directory to hold your checked-out projects:
mkdir ~/workspace
- Navigate to that new directory:
cd ~/workspace
- Clone the repository:
git clone URL_FROM_STEP_1
- If working with an application that uses MySQL, install MySQL 5.5.
- If working with Ngin, install freeimage:
brew install freeimage
.
Bundler installs all necessary Ruby dependencies and provides access to the scripts provided by our Automation gem.
- Navigate into the checked-out project:
cd ~/workspace/NAME_OF_DIRECTORY
- If you're prompted to install a missing version of Ruby, perform the command that RVM provides to you, to install that version of Ruby.
- Ensure that everything is installed with
bundle
command. - Run whichever command you want, prefixed with
bundle exec
. For example,bundle exec deploy
orbundle exec deployable 123
.
If you want to run the application, some more steps are required.