Put the start and stop task contents in methods and call those methods from 
within the start stop tasks; then you can create the restart method by calling 
the requisite start stop methods. 

Since the commands in the method will always be running in the task that was 
directly invoked it should act the way you need. 

You need to be careful with naming as methods will take precedence over tasks 
when you use the namespace to call them. 

On Jan 3, 2012, at 5:26 AM, Haim Ashkenazi <[email protected]> wrote:

> Hi Lee
> 
> On Jan 3, 12:26 pm, Lee Hambley <[email protected]> wrote:
>> Haim,
>> 
>> Can you share your implementation that I might better understand what you 
>> are trying to achieve?
> The deploy is a little complicated and requires a lot of steps but let
> me give you a simple example. We have a java web app that needs to be
> restarted and needs to unregister itself form the load balancer before
> and re-register after (to avoid someone getting unavailable error -
> amazon ELB frequency for checking availability is pretty low). so we
> might want to have 5 tasks (in order to perform some actions without
> logging to the machine):
> 
> - app:start
> - app:stop
> - app:restart
> - elb:start
> - elb:stop
> 
> The `app:restart` task consist of:
> - elb:stop
> - app:stop
> - app:start
> - elb:start
> 
> In order to create a rolling restart (like described in my previous
> email) I need to copy/paste the logic from all of these tasks to the
> 'app:restart' task. I was hoping I could call the required tasks
> directly from the restart task and still be able to tell them to run
> consecutively.
> 
> Bye
> --
> Haim
> 
> -- 
> * 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 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

Reply via email to