Deploy scripting with Thor using remote Ruby execution
Pull request Compare This branch is 54 commits behind wesabe:master.
Latest commit 5418505 May 31, 2008 Brian Donovan Make it handle invalid sudo passwords.


Robot Army

Robot Army is deploy scripting which offers remote execution of Ruby in addition to the usual shell scripting offered by other deploy packages.

If you want to test this, be sure that the robot-army gem is installed on both the client and server machines. You should get an error if you try to execute it against a server with it installed.


class AppServer < RobotArmy::TaskMaster
  host ''

  desc "time", "Get the time on the server (delta will be slightly off depending on SSH delay)"
  def time
    rtime = remote{ }
    ltime =

    say "The time on #{host} is #{rtime}, " +
        "#{(rtime-ltime).abs} seconds #{rtime < ltime ? 'behind' : 'ahead of'} localhost"

  desc "deployed_revision", "Gets the deployed revision"
  def deployed_revision
    say "Checking deployed revision on #{host}"
    say "Deployed revision: #{remote{"/opt/app/current/REVISION") }}"

Known Issues

  • Code executed in remote has no access to instance variables, globals, or methods on self
  • Multiple hosts are not yet supported
  • Probably doesn't work with Windows