Skip to content

Instantly share code, notes, and snippets.

@JazzJackrabbit
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save JazzJackrabbit/0a98c76ff926ce9e4f85 to your computer and use it in GitHub Desktop.

Select an option

Save JazzJackrabbit/0a98c76ff926ce9e4f85 to your computer and use it in GitHub Desktop.
Bash scripts for Rails apps
# --- Setup.sh (Rails) ---
##!/bin/sh
bundle install
# set configuration
cp -n config/database.yml.dist config/database.yml
echo "- default config copied"
$EDITOR config/database.yml
echo "- config is set"
rake db:create
rake db:schema:load
# rake samples:load
# --- Start.sh (Rails) ---
#!/bin/sh
NO_UPDATE_FLAG="--no-update"
if [ "$1" != "$NO_UPDATE_FLAG" ]; then bin/update; fi
# --- Update.sh (Rails) ---
#!/bin/sh
git pull
bundle install
rake db:migrate
# bin/browser &
script/rails s
# --- Browser.sh ---
#!/bin/bash
sleep 7 # magic number
launchy http://localhost:3000/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment