Skip to content
This repository has been archived by the owner on May 8, 2018. It is now read-only.
/ robot-army Public archive

Deploy scripting with Thor using remote Ruby execution

License

Notifications You must be signed in to change notification settings

wesabe/robot-army

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Example

class AppServer < RobotArmy::TaskMaster
  host 'app1.prod.example.com'
  
  desc "time", "Get the time on the server (delta will be slightly off depending on SSH delay)"
  def time
    rtime = remote{ Time.now }
    ltime = Time.now
    
    say "The time on #{host} is #{rtime}, " +
        "#{(rtime-ltime).abs} seconds #{rtime < ltime ? 'behind' : 'ahead of'} localhost"
  end
  
  desc "deployed_revision", "Gets the deployed revision"
  def deployed_revision
    say "Checking deployed revision on #{host}"
    say "Deployed revision: #{remote{ File.read("/opt/app/current/REVISION") }}"
  end
end

Known Issues

  • Code executed in remote has no access to instance variables or globals
  • Probably doesn't work with Windows

About

Deploy scripting with Thor using remote Ruby execution

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages