Skip to content

Commit

Permalink
use rake_cmd instead of 'heroku rake'
Browse files Browse the repository at this point in the history
cedar uses a 'heroku run rake' instead of 'heroku rake'.
Fixes jacquescrocker#10
  • Loading branch information
nevinera committed Dec 7, 2011
1 parent f5231f6 commit 266b2d0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/heroku/rails/tasks.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ def system_with_echo(*args)
Rake::Task["heroku:before_each_deploy"].reenable Rake::Task["heroku:before_each_deploy"].reenable
Rake::Task["heroku:before_each_deploy"].invoke(app_name) Rake::Task["heroku:before_each_deploy"].invoke(app_name)


rake_cmd = HEROKU_CONFIG.rake_cmd(heroku_env)

branch = `git branch`.scan(/^\* (.*)\n/).flatten.first.to_s branch = `git branch`.scan(/^\* (.*)\n/).flatten.first.to_s
if branch.present? if branch.present?
@git_push_arguments ||= [] @git_push_arguments ||= []
system_with_echo "git push #{repo} #{@git_push_arguments.join(' ')} #{branch}:master && heroku rake --app #{app_name} db:migrate && heroku restart --app #{app_name}" system_with_echo "git push #{repo} #{@git_push_arguments.join(' ')} #{branch}:master && #{rake_cmd} --app #{app_name} db:migrate && heroku restart --app #{app_name}"
else else
puts "Unable to determine the current git branch, please checkout the branch you'd like to deploy" puts "Unable to determine the current git branch, please checkout the branch you'd like to deploy"
exit(1) exit(1)
Expand Down Expand Up @@ -179,7 +181,8 @@ def system_with_echo(*args)
desc "Migrates and restarts remote servers" desc "Migrates and restarts remote servers"
task :migrate do task :migrate do
HEROKU_RUNNER.each_heroku_app do |heroku_env, app_name, repo| HEROKU_RUNNER.each_heroku_app do |heroku_env, app_name, repo|
system_with_echo "heroku rake --app #{app_name} db:migrate && heroku restart --app #{app_name}" rake_cmd = HEROKU_CONFIG.rake_cmd(heroku_env)
system_with_echo "#{rake_cmd} --app #{app_name} db:migrate && heroku restart --app #{app_name}"
end end
end end


Expand All @@ -200,4 +203,4 @@ def system_with_echo(*args)
end end
end end
end end
end end

0 comments on commit 266b2d0

Please sign in to comment.