I don't actually know what causes the crash here but two things stand out: You don't have to do the invoke() within an on() block. The task is invoked on your machine, the capistrano host, it does not get doled up to the various servers you have. Second, in invoke() you need to refer to the task with it's fully qualified name, including namespace (that would be "test: check_write_permissions"
Again, the task dependencies would function much better in the example you have posted: task :deployPre => : check_write_permissions since both tasks are in the same namespace you can skip the FQNs and spare yourself some typing. Use of invoke() is justified in cases where you want to do some conditional logic within a task and differentiate on what you're invoking. Within rake (it's the same logic) I also use it to collect dependencies dynamically before task invocation but I haven't a good enough scenario for cap yet. Most of the times though the task dependency syntax task :foo =>[:bar,:baz] works fine and is a lot more readable. As an aside, you can do some pretty nifty things by following the standard, for example you can generate graphs of task dependencies in .dot syntax, let rake parallelise automatically etc. invoke() hides this information and it's also a bit dangerous because you might assume that with invoke() the task is always executed when this is not the case - in cap as in rake tasks are executed once and only once no matter how many times they are invoked. Cheers, V.- -- -- * 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.
