Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can't invoke rake task from script #615

Closed
rhombl4 opened this issue Mar 22, 2018 · 3 comments
Closed

Can't invoke rake task from script #615

rhombl4 opened this issue Mar 22, 2018 · 3 comments

Comments

@rhombl4
Copy link

rhombl4 commented Mar 22, 2018

When i run my rake task directly mina staging rake[backup:db] it's working fine, but when i try to do this thru deploy-script by mina staging backup_db i got error Don't know how to build task 'rake[backup:db]'

desc 'Backup database.'
task backup_db: :remote_environment do
  invoke :'rake[backup:db]'
end
@AnubixXx
Copy link

I have the same problem.

Actually I can run from terminal: mina rake[sitemap:create]
If i add it to deploy.rb like: invoke :'rake[sitemap:create]', it doesnt work.
I also tried co create task like u, still the same problem, rake[sitemap:create] command not found.

@jonnynux
Copy link

jonnynux commented Apr 1, 2019

Similar problem here, if I invoke two, or more, consecutive command (rake commands), only the first is called. If I have other command, but not invokes, the commands are executed. I'm currently using mina 0.3.8.

@lovro-bikic
Copy link
Member

When using rake or rails commands from deploy scripts, the task that you want to execute should be passed as an argument, like this:

task :backup_db do
  invoke :rake, 'backup:db'
end

or, with Rails:

task :backup_db do
  invoke :rails, 'backup:db'
end

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants