Skip to content

Instantly share code, notes, and snippets.

Created November 22, 2017 03:09
  • Star 19 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save r00k/ab4dce37603cd94466c9955eee88ffe1 to your computer and use it in GitHub Desktop.
# Set up Rails app. Run this script immediately after cloning the codebase.
# Exit if any subcommand fails
set -e
# Copy over configs
if ! [ -f .env ]; then
cp .sample.env .env
# Set up Ruby dependencies via Bundler
gem install bundler --conservative
bundle check || bundle install
# Set up database
bin/rake db:setup db:test:prepare
# Only if this isn't CI
if [ -z "$CI" ]; then
# Set up development seed data
bin/rake dev:bootstrap
# Add Heroku remotes
git remote add staging || true
git remote add production || true
# Join the apps
heroku join --app this-app-staging || true
heroku join --app this-app-production || true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment