I have two custom "restart" tasks that restart apache and nginx,
respectively. I put :on_error => :continue on both.
After the Apache "restart" throws an error twice in the same script
(my fault), any subsequent calls to that task seem to get ignored...
Has anyone else experienced this? I can see how this may be a feature
for one call to "cap" on the command line, but the behavior persists
to the next time I use "cap" -- does the result of each task get
cached somehow?
> I have two custom "restart" tasks that restart apache and nginx,
> respectively. I put :on_error => :continue on both.
> After the Apache "restart" throws an error twice in the same script
> (my fault), any subsequent calls to that task seem to get ignored...
> Has anyone else experienced this? I can see how this may be a feature
> for one call to "cap" on the command line, but the behavior persists
> to the next time I use "cap" -- does the result of each task get
> cached somehow?
I have :on_error => :continue on the "appliance:apache:restart" task,
so it correctly continues the first time, but the next time it
encounters "appliance:apache:restart" it seems to ignore it (in this
case it continues on to execute "appliance:php:install").
Then I run the same "cap" command on the command line. In this case, I
have an "after('deploy:setup')" block that goes on to install the LAMP
stack. Soo when I run the same cmd again, and it gets to the
"appliance:apache:restart" part, cap ignores it completely:
> > I have two custom "restart" tasks that restart apache and nginx,
> > respectively. I put :on_error => :continue on both.
> > After the Apache "restart" throws an error twice in the same script
> > (my fault), any subsequent calls to that task seem to get ignored...
> > Has anyone else experienced this? I can see how this may be a feature
> > for one call to "cap" on the command line, but the behavior persists
> > to the next time I use "cap" -- does the result of each task get
> > cached somehow?
I was trying to reproduce this behaviour in a simple task but I cann't :-(
I tried with this task:
desc "Something to check it" task :on_error_test, :on_error => :continue, :role => :app do run "~/foobar.sh" end
foobar.sh is a simple script(echo message), it's stored in all hosts except only one to make it fail. And it show me a correct behaviour. The task is executed in all servers fail or not fail.
The second test that I did was write a syntax error in the script (a command not found) and one server without the script. The task was executed in all servers likewise.
The third and last test, I added a exit 1 (I test it with an exit 2 too) in the script to return an exit value. And again I cann't reproduce it :-(