A failed command aborts Capistrano, by default. If you want Capistrano
to continue with subsequent tasks in spite of failed commands, you can
define your tasks like this:
task :foo, :on_error => :continue do
...
end
See http://wiki.capify.org/article/Task for more on the options you can
give to task.
(Heads up re: the recent cap wiki articles I've posted this morning:
this is very beta, and the URL's may very well change in the near
future, so don't bookmark anything. :) I'm just using these to test the
documentation and see if it can really help people.)
- Jamis
On 1/22/09 9:09 AM, Gerhardus Geldenhuis wrote:
> Thanks,
> I need to configure wget that it does not try 60 times in one second
> but that is just some man page reading.
>
> My confusions were that I was assuming that capistrano would "handle"
> exit 1 statements and not fail completely.
>
> Regards
>
> On Jan 22, 3:56 pm, Mike Bailey <[email protected]> wrote:
>> For 60 retries use:
>>
>> if wget --tries=60 --wait=1 --connect-timeout=1 --timeout=1
>> --quiethttp://localhost:8080/;then echo 'success'; else echo 'fail'; fi;
>> exit 0
>>
>> I don't understand why you suggest not to fail with exit 1. The task
>>
>>> has failed. The plan is that I want to later on implement rollback
>>> logic and then I need the task to fail to trigger the rollback logic.
>> exiting on anything but 0 halts capistrano.
>>
>>
>>
>>> I am also unsure about where you meant me to put the [puts "fail"]
>>> statement. Surely it must be in a if statement of some sorts otherwise
>>> it would just print fail regardless of whether it worked or not.
>> Sorry, I'm a bit sleepy. The shell command above is echoing success or fail.
>>
>> - Mike
> >
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---