Code Monkey home page Code Monkey logo

robot-army's Introduction

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

robot-army's People

Contributors

kevinclark avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.