Skip to content

Instantly share code, notes, and snippets.

@ehlertij
Forked from pbyrne/instructions.markdown
Last active December 19, 2015 12:09
Show Gist options
  • Save ehlertij/5953120 to your computer and use it in GitHub Desktop.
Save ehlertij/5953120 to your computer and use it in GitHub Desktop.

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.

Prepare Laptop

Install Xcode and Command-Line Build Tools

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

Install Development Tools

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).

  1. Install Homebrew with the following command: ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
  2. Install some development dependencies with the newly installed Homebrew: brew install git
  3. Install RVM with the following command: curl -L https://get.rvm.io | bash -s stable
  4. Tell RVM to use Homebrew to install any missing dependencies: rvm autolibs brew.
  5. Install Node.js: brew install node
  6. Install Grunt (a Node.js tool to perform tasks in your project) with the command: npm install -g grunt-cli
  7. Close your Teriminal window and open a new one. This will ensure that the settings changes from the above steps take effect.

Get Code from GitHub

Set Up SSH For GitHub

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 git@github.com. 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.

  1. 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.
  2. Copy the contents of the newly generated public key with the following command: pbcopy < ~/.ssh/id_rsa.pub
  3. Browse to GitHub's SSH settings page and click the Add Key button.
  4. Give the new key a descriptive name ("Sport Ngin laptop SSH key") and paste the contents of the public key into the space provided.

Clone Repositories

  1. Fetch the URL to clone a repository from the project's page on GitHub.
  2. Create a directory to hold your checked-out projects: mkdir ~/workspace
  3. Navigate to that new directory: cd ~/workspace
  4. Clone the repository: git clone URL_FROM_STEP_1

Install Application-Specific Dependencies

  1. If working with an application that uses MySQL, install MySQL 5.5.
  2. If working with Ngin, install freeimage: brew install freeimage.

Perform Bundle

Bundler installs all necessary Ruby dependencies and provides access to the scripts provided by our Automation gem.

  1. Navigate into the checked-out project: cd ~/workspace/NAME_OF_DIRECTORY
  2. 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.
  3. Ensure that everything is installed with bundle command.
  4. Run whichever command you want, prefixed with bundle exec. For example, bundle exec deploy or bundle exec deployable 123.

If you want to run the application, some more steps are required.

Perform Grunt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment