capistrano/capistrano — pull request #810 by andytinycat (2013-11-26 15:18:50+00:00)
Title: Add ability to filter tasks to specific servers (host filtering).

This commit adds the ability to control what servers are involved in an
task from the command line, or by setting an environment variable.

The filter contains a list of servers; these are the only servers that
will be involved in the task.

For example, if you had three servers defined in your configuration
(server1, server2 and server3), you could deploy to only server1 by
doing either:

cap --hosts server1 production deploy

Or:

HOSTS=server1 cap production deploy

Multiple servers can be specified by separating them with commas:

cap --hosts server1,server2 production deploy
HOSTS=server1,server2 cap production deploy

Host filtering happens after role filtering, and does not change what
roles a server will respond to.