I have tasks stop and start and want to make restart task which calls stop 
and start. What's syntax for it in Capistrano 3?

namespace :server do

  desc "Start server"
  task :start do
    on roles :app do
      # start server
    end
  end

  desc "Stop server"
  task :stop do
    on roles :app do
      # stop server
    end
  end

  desc "Restart server"
  task :restart do
    on roles :app do
      stop
      start
    end
  end
end


I'm getting error:
cap aborted!
undefined local variable or method `stop' for 
#<SSHKit::Backend::Netssh:0x007f840811c130>
config/deploy/dev.rb:40:in `block (3 levels) in <top (required)>'
Tasks: TOP => server:restart
(See full trace by running task with --trace)

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to