gunpowderlabs / buildpack-ruby-rake-deploy-tasks

Run arbitrary rake tasks on deploy to Heroku
MIT License
146 stars 79 forks source link

Can't run more than 1 rake task #5

Closed kamui closed 8 years ago

kamui commented 8 years ago

I haven't had luck running more than 1 rake task.

Given:

DEPLOY_TASKS="tmp:clear assets:clobber"

On deploy, when it runs the rake task I get the equivalent of:

Don't know how to build task 'tmp:clear assets:clobber'
/Users/ubuntu/.rubies/ruby-2.2.4/lib/ruby/2.2.0/rake/task_manager.rb:62:in `[]'
/Users/ubuntu/.rubies/ruby-2.2.4/lib/ruby/2.2.0/rake/application.rb:149:in `invoke_task'
/Users/ubuntu/.rubies/ruby-2.2.4/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/ubuntu/.rubies/ruby-2.2.4/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/Users/ubuntu/.rubies/ruby-2.2.4/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/Users/ubuntu/.rubies/ruby-2.2.4/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/Users/ubuntu/.rubies/ruby-2.2.4/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/Users/ubuntu/.rubies/ruby-2.2.4/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/Users/ubuntu/.rubies/ruby-2.2.4/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/Users/ubuntu/.rubies/ruby-2.2.4/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/Users/ubuntu/.rubies/ruby-2.2.4/bin/rake:33:in `<main>'

Either of these work:

DEPLOY_TASKS="tmp:clear"
DEPLOY_TASKS="assets:clobber"
devosnw commented 8 years ago

@kamui I also use this buildpack and have experienced the same issue. I think this is due to how the arguments are passes to rake in the compile script. What I ended up doing is making another rake task that calls all the rake tasks I want to run using some help from Stack Overflow. I called mine deploy:production and it runs several tasks related to a production deployment. This way you can set one task in the DEPLOY_TASKS envvar and it will work as intended.

I know it doesn't fix the actual issue but this worked pretty good for me.

kamui commented 8 years ago

Thanks @devosnw. I've thought about doing that too and it would probably work. Somehow I got this to work as is and I'm not sure how. I kept trying it and at some point it started working, but it's good to know someone saw this issue before because I was definitely stuck with this error for the better part of a day.

davesloan commented 8 years ago

I created a pull request to fix this issue. https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks/pull/6

wrozka commented 8 years ago

Closed by @davesloan pull request(#6).