desc ‘Run all the processes for pushing to production’ namespace :pushie do
task :ready do branch_name = `git rev-parse --abbrev-ref HEAD` if branch_name.strip.chomp != "master" puts "\n[Pushie]: You must be on branch master\n\n" else system("bundle exec rake assets:clobber RAILS_ENV=production") puts "\n[Pushie]: Assets have been clobbered for production, precompiling...\n\n" system("bundle exec rake assets:precompile RAILS_ENV=production") puts "\n[Pushie]: Assets have been precompiled for production, readying git...\n\n" system("git add -A") system("git commit -m 'pushie ~ set up for production'") system("git push origin master") puts "\n[Pushie]: Pushing to git origin master...\n\n" system("git push origin master") puts "\n[Pushie]: Assets have been precompiled for production\n\n" end end task :push do system("git push heroku master") puts "\n[Pushie]: You pushed to heroku master\n\n" end
end