mina-deploy / mina

Blazing fast deployer and server automation tool

Home Page:https://rubygems.org/gems/mina

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't invoke rake task from script

rhombl4 opened this issue · comments

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

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.

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.

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