Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use rake_cmd instead of 'heroku rake'

cedar uses a 'heroku run rake' instead of 'heroku rake'.
Fixes #10
  • Loading branch information...
commit 266b2d01767904092e82bebf23315c469690095a 1 parent f5231f6
@nevinera authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/heroku/rails/tasks.rb
View
9 lib/heroku/rails/tasks.rb
@@ -62,10 +62,12 @@ def system_with_echo(*args)
Rake::Task["heroku:before_each_deploy"].reenable
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
if branch.present?
@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
puts "Unable to determine the current git branch, please checkout the branch you'd like to deploy"
exit(1)
@@ -179,7 +181,8 @@ def system_with_echo(*args)
desc "Migrates and restarts remote servers"
task :migrate do
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
@@ -200,4 +203,4 @@ def system_with_echo(*args)
end
end
end
-end
+end

0 comments on commit 266b2d0

Please sign in to comment.
Something went wrong with that request. Please try again.