Last active
August 29, 2015 14:23
-
-
Save arturoherrero/d162acfff69bed336da1 to your computer and use it in GitHub Desktop.
Deploy Rails app to Heroku environments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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