mina-deploy / mina

Blazing fast deployer and server automation tool
https://rubygems.org/gems/mina
Other
4.36k stars 491 forks source link

Can't invoke rake task from script #615

Closed rhombl4 closed 3 years ago

rhombl4 commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

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 commented 3 years ago

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