lib/dkdeploy/dsl.rb
def invoke_for_server(server, task, *args)
      backup_filter = fetch :filter, {}
      new_server_filter = Marshal.load(Marshal.dump(backup_filter))
      new_server_filter[:host] = server.hostname
      set :filter, new_server_filter
      env.setup_filters
      info I18n.t('dsl.invoke_for_server.set_filter', task: task, host: server.hostname, scope: :dkdeploy)
      invoke! task, *args
    ensure
      set :filter, backup_filter
      env.setup_filters
    end
def invoke_for_server(server, task, *args)
      backup_filter = fetch :filter, {}
      new_server_filter = Marshal.load(Marshal.dump(backup_filter))
      new_server_filter[:host] = server.hostname
      set :filter, new_server_filter
      env.setup_filters
      info I18n.t('dsl.invoke_for_server.set_filter', task: task, host: server.hostname, scope: :dkdeploy)
      invoke! task, *args
    ensure
      set :filter, backup_filter
      env.setup_filters
    end
Execute a rake/capistrano task only for given server

 @param server [Capistrano::Configuration::Server] Server to execute task
 @param task [String] Name of rake/capistrano task
 @param args [Array] Arguments of rake/capistrano task