Skip to content

Latest commit

 

History

History
113 lines (75 loc) · 1.75 KB

File metadata and controls

113 lines (75 loc) · 1.75 KB

Contributor's Guide

This document describes the process of setting up a local development environment on Mac OS X.

Prerequisites

Install the Homebrew package manager, if necessary:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install the PostgreSQL database management system, if necessary:

brew install postgresql
brew services start postgresql
createdb

Install the Ruby language (version 2.2.3), if necessary:

brew install rbenv
rbenv install 2.2.3
rbenv global 2.2.3

Install the Bundler and Rails command line utilities, if necessary:

gem install bundler
gem install rails

Setup environment variable(s) in your profile:

export TONEBASE_CLIENT_TOKEN="abc123" # shared with client application and excluded from version control

Installation

Download the source code:

git clone git@github.com:data-creative/tonebase-api.git
cd tonebase-api/
bundle install

Setup Database

Setup the database:

bin/rake db:setup

Seed the database:

bin/rake db:seed

Migrate the database, if necessary:

bin/rake db:migrate

Developing

Run a local web server:

bin/rails s

Run a local rails console:

bin/rails c

Testing

Run tests:

bundle exec rspec spec/

Deploying

Gain access to the Heroku application called "tonebase-api", then deploy when ready:

git pull origin master
git push origin master
git push heroku master

If deploying for the first time, seed the production database:

heroku run "bin/rake db:seed"

If the changes require a database migration, run:

heroku run "bin/rake db:migrate"