On Feb 13, 2007, at 10:37 PM, Mike Bailey wrote: > > Capistrano stops if it see's a non-zero return code. I'd like to be > able to perform conditional > actions on remote hosts by running tests on them and checking the > results from within > my deploy task. Something like: > > if run "uname -a | grep amd64" > deprec.update_user_crontab(:mongrel, "LD_PRELOAD=/usr/lib/jvm/ > java-1.5.0-sun-1.5.0.06/jre/lib/amd64/libzip.so") > end > > From hacking the code it seems to be really hard to get things back > from more than > just the first target server. This could be command output, return > codes or files. > > One answer is to move this conditional logic onto the servers in the > form or more > complex bash commands or ruby scripts. > > Another would be to extend Capistrano be able to run commands on > multiple machines > and do things with the output (pull back logfiles, tcpdumps, etc; get > output of commands > and do conditional login in the task or Capistrano functions). > > I'd really like to be able to have tasks check what distro is running > on the remote system > so that my tasks could use the appropriate capistrano plugins.
Mike, this is kind of what the "capture" helper was implemented for. It only queries one machine, though, so if you're in an environment where each of your target machines might be a different distro...well, you'd probably be better off with separate scripts for each set of distros. > Jamis, how much work do you think it would be to implement this? Can > you point to where > the hard bits would be? If I'm understanding you, it'd be quite hard. Then again, I might be misunderstanding what you're proposing. If you want to get at the return codes, look at the capistrano/command.rb abstraction. The hard part would not be in capturing the return codes, but in handling multiple return codes that may not be the same between servers. - Jamis --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
