Created
August 19, 2014 17:17
-
-
Save nickserv/da14566ed730b4944416 to your computer and use it in GitHub Desktop.
Rake task for deploying a Rails app to Heroku
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
# Deploy to Heroku in production | |
task deploy: ['deploy:push', 'deploy:migrate'] | |
namespace :deploy do | |
APP = 'openatrit' | |
task :push do | |
puts 'Deploying site to Heroku ...' | |
puts `git push -f [email protected]:#{APP}.git master` | |
end | |
task :restart do | |
puts 'Restarting app servers ...' | |
puts `heroku restart --app #{APP}` | |
end | |
task :migrate do | |
puts 'Running database migrations ...' | |
puts `heroku run rake db:migrate --app #{APP}` | |
end | |
task :off do | |
puts 'Putting the app into maintenance mode ...' | |
puts `heroku maintenance:on --app #{APP}` | |
end | |
task :on do | |
puts 'Taking the app out of maintenance mode ...' | |
puts `heroku maintenance:off --app #{APP}` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment