Run a Capistrano task on a single server in a given role February 7, 2008Posted by John Dewey in Capistrano, Code, Command Line, Deployment, Monkey Patch.
There are times I want to run a Capistrano task on a single server, rather than every system in the role. Adding this monkey patch to deploy.rb adds this functionality. To utilize this feature append ‘server=IP_ADDRESS’ to the Cap command. Tasks are defined to run on particular role(s), this feature will target the server inside a particular tasks role. It will not execute a task on an arbitrary server. CJ Kihlbom filled me in and stated this can be accomplished with `cap deploy HOSTS=IP_ADDRESS`. See his comments attached to this post.