Skip to content

Instantly share code, notes, and snippets.

@jeromedalbert
Forked from r00k/setup.sh
Created February 10, 2021 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeromedalbert/c8aea505c77df31d5559c0ba4bfdb4f6 to your computer and use it in GitHub Desktop.
Save jeromedalbert/c8aea505c77df31d5559c0ba4bfdb4f6 to your computer and use it in GitHub Desktop.
#!/bin/sh
# 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
fi
# 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 https://git.heroku.com/this-app-staging.git || true
git remote add production https://git.heroku.com/this-app-production.git || true
# Join the apps
heroku join --app this-app-staging || true
heroku join --app this-app-production || true
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment