Skip to content

Instantly share code, notes, and snippets.

@arturoherrero
Last active August 29, 2015 14:23
Show Gist options
  • Save arturoherrero/d162acfff69bed336da1 to your computer and use it in GitHub Desktop.
Save arturoherrero/d162acfff69bed336da1 to your computer and use it in GitHub Desktop.
Deploy Rails app to Heroku environments
#!/usr/bin/env bash
deploy_to_production() {
read -p "Are you sure? " -r
if [[ $REPLY =~ ^(yes|y|Y)$ ]]; then
git push production master && heroku run rake db:migrate -a app-production
fi
}
deploy_to_staging() {
current_branch=`git rev-parse --abbrev-ref HEAD`
git push staging $current_branch:master -f && heroku run rake db:migrate -a app-staging
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment