Regiment

A simple, self-contained, RESTful script/job management framework in Ruby.

Script Library

The vision for Regiment is a world where one-off, un-monitored, snowflake scripts are a thing of the past. As such, Regiment implements a standard structure for scripts(orders) and how we store them:

  • All orders must inherit from the Regiment::Order class and should override the Regiment::Order.execute function.
  • All orders must inhabit a similarly named directory with a README.
  • Any custom output(report) format should be defined by overriding the Regiment::Order.report function.

The directory structure for your orders library should look like this:

/etc/regiment/orders
|- scriptOne/
|-- scriptOne.rb
|-- README
|- scriptTwo/
|-- scriptTwo.rb
|-- README

API

Regiment implements an API through which you can trigger scripts(orders), view which orders are in progress and various other useful actions. The API can be started with the command regiment-api.

Endpoints

GET /version - This returns the version of Regiment you have running.

GET /execute/<order> - Executes the specified order and reports back.

GET /about/<order> - Displays the README for the specified order.

CLI

Regiment comes with a tool regiment that implements the interface of the API on your command line to squeeze yet more efficiency out of your workflow.

Sub Commands

version - Returns the version of Regiment used by the client and the version used by the endpoint.

execute <order> - Executes the specified order and reports back.

about <order> - Displays the README for the specified order.

Options

--regiment - String - The hostname(including port) of your Regiment endpoint e.g. localhost:1234

Contributing

Rake

To build and install the gem locally during development ensure you are in the root of the repository and run:

rake buildinstall