Created
June 20, 2014 19:55
-
-
Save ddarren/268f21211a3c22480a86 to your computer and use it in GitHub Desktop.
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
# based off of http://derekdevries.com/2009/04/13/rails-seed-data/ | |
require 'active_record/fixtures' | |
namespace :deploy do | |
desc "Deploy staging to heroku" | |
task :staging do | |
root = Rake.application.original_dir | |
command = "cd #{root} && git push heroku master && \ | |
heroku pg:reset amber --confirm sample-app-staging && \ | |
heroku run rake db:redis:reset && \ | |
heroku run rake db:migrate && \ | |
heroku run rake db:seed && \ | |
heroku run rake db:seed_dummy_data" | |
# command = "cd #{root} && git push heroku master && \ | |
# heroku run rake db:migrate" | |
IO.popen(command) do |output| | |
while line = output.gets do | |
puts line | |
end | |
end | |
end | |
desc "Deploy production to heroku" | |
task :production do | |
root = Rake.application.original_dir | |
command = "cd #{root} && git push production master && \ | |
heroku run rake db:migrate --app sample-app-production && \ | |
heroku run rake db:seed --app sample-app-production" | |
IO.popen(command) do |output| | |
while line = output.gets do | |
puts line | |
end | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment