Created
December 5, 2017 16:19
-
-
Save Schwad/3ad751be1e37dbe12e8c1428e82e1d5e to your computer and use it in GitHub Desktop.
bin/deploy deployment of a Ruby on Rails application to Heroku
This file contains hidden or 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
# Sets up APPLICATION_NAME_HERE and deploys to Heroku. This should be run while on master | |
# NOTE: if you get a permission denied error, try running `chmod u+x bin/deploy` in the terminal | |
# Fails script if any commands fail | |
set -e | |
echo '== Installing dependencies ==' | |
bundle install | |
# Sets up the database | |
echo '== Preparing database ==' | |
RAILS_ENV=production bundle exec rake db:migrate | |
echo '== Preparing assets ==' | |
rake assets:precompile | |
git add -A | |
git commit -m 'vendor compiled assets' | |
echo '== Deploying ==' | |
# Pushes to Heroku and updates with changes | |
git push heroku master | |
heroku run rake db:migrate | |
heroku restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment