LEROY

Cross-platform automated software deployment language

Leroy is a software deployment engine designed to allow software and build/release engineers to describe the deployment of an application in plural environments with a singular workflow in xml, which is intended to be versioned in your repository as code, in the service of continuous integration and continuous deployment.

DOWNLOAD

leroy overview

Leroy is a fast, lean threaded tool that is written for multiple platforms in C++. It consists of two major components; the agent and the controller. The agents are run on any system you wish to perform tasks on. They do not listen on a port; instead, they reach out to the controller and wait for it to come online. The controller contains all the configuration and artifacts needed to perform a deployment to all environments and is launched on demand. Leroy provides the complete picture for continuous integration and continuous deployment, which is a requirement for agile software development. Best of all, Leroy is free to use for commercial and non-commercial use under the creative commons license.

When there is work to be done, the controller is started and accepts connections from the agents. When all the agents needed in a given environment check in with the controller, the controller issues workflow steps to the agents and receives output from the agents. This all operates in a multi-threaded fashion with synchronization controls to maximize flexibility and minimize how long deployments take.

One of the design goals of Leroy was to provide a simplified programming language to describe the deployment of an application to all environments, end-to-end in a easy to read and well-known format.

how can i use leroy?

  • As an application deployment automation framework.
  • As a library for an existing application that you want to have auto-update
    capability.
  • As an automation tool for unix/linux/windows or mac system
    administrators.
  • As an extension in your existing build tool to provide automated
    deployment capabilities.
  • As a configuration management tool.
  • As an automated database deployment tool.
  • There are many other uses to Leroy, please Tell us how you are using it
  • VIEW MORE

Leroy allows you to add the feature of deployment automation in ANY build system. Build systems include (but are not limited to):

  • Jenkins http://jenkins-ci.org/
  • Team City http://www.jetbrains.com/teamcity/
  • Bamboo https://www.atlassian.com/software/bamboo
  • Apache Continuum http://continuum.apache.org/
  • More…

To initiate a deployment, one simply executes the controller executable as:
c:\Leroy> controller.exe --workflow Initialize --environment dev
or from your favorite *nix:
$/home/leroy> ./controller --workflow Initialize --environment dev

The controller will come online and wait for all agents in the dev environment to connect. Once the controller sees all the agents have reported in, the deployment begins. The controller will return 0 to the shell if the deployment is successful, and non-zero if it is not, allowing any build system to easily detect if the deployment has completed or failed.

controller structure

  • agents.xml: An XML file describing the agents the controller is aware of.
  • environments.xml: An XML file describing the environments (grouping of agents) the controller can run workflows against.
  • controller.xml: An XML file that configures the controller. Its bind address, port, known hostname, etc.
  • postprocess.xml: An XML file defining available postProcess scripts.
  • commands/: A folder of files (typically scripts) that can be transmitted to agents for execution.
  • artifacts/: A folder containing the files that may be sent to agents.
  • workflows/: A folder containing XML files that describe different workflows that the controller may run.
  • properties/: A folder containing XML files defining properties on various levels
  • global.xml – Controller-global properties
  • agent/.xml – Agent properties
  • environment/.xml – Environment properties
  • agents/: A folder containing folders of agent binary packages for each platform
    • Win64
    • Linux-i686
    • Linux-x86_64
    • Darwin-x86_64
  • installed_agents/: A folder containing folders of prepared agents and keys that have been generated by the controller, ready for installation on the target host.
  • controller.exe: The main controller executable.
  • .so / .dll / .dylib: Libraries used by the controller.
  • controller.crt / controller.key / dh512.pem: Files used by the controller for SSL – certificate, private key, Diffie-Hellman parameters.

controller usage

						

Usage: controller [--config ] [--addagent |--extract-agent |--extractagent-all|--ssh-install   [--agent-name ]| {--add-*-property =}]

Program Options:
    --help This message
    -v [ --version ] Print version info.
    --addagent Add a new agent to the system.
    --extractagent arg Re-generate an agent .zip installation package.
    --extractagent-all Re-generate .zip installation package for all agents.
    --ssh-install arg SSH install an already generated agent.
    --workflow arg The workflow to run
    --environment arg The environment to operate on.
    --environment-file arg (=environments.xml) The file(s) where environments are defined.
    --config arg An optional configuration file. Default: controller.xml
    --port arg The port to listen on for agents. If not given, the configuration file's "port" attribute will be used.
    --add-global-property arg Add controller-global property. Can be used 0 or more times. Argument format is KEY=VAL
    --add-workflow-property arg Add property to the workflow. Can be used 0 or more times. Argument format is KEY=VAL
    --add-environment-property arg Add property to the environment. Can be used 0 or more times. Argument format is KEY=VAL
    --preflight-check This will validate the given workflow
 on the given environment.
    --no-check-artifacts This will prevent nonexistent transfer artifacts from causing prefight check failure. Can be used only with
    --preflight-check.
    --force-agent-update This will update agents (even if they are up to date)
    --generate-configs Recursively loads files from resources (specified in the 'configuration' step of the workflow) and copies them to a temporary directory, compiling properties in the file.
    --leroy-configuration-root arg Custom root directory to load configuration files from.
    --deploy-only arg Deploy only to the specified agent IDs instead of all agents in the target environment.
    --disable-full-agent-checkin When agent checkin timeout is over, continue with all the agents that have reported in thus far, if any, instead of aborting the deployment.
    --clean-ipc Remove all IPC objects and set up fresh ones. IMPORTANT: use this only when no other controller process is running on the system!

AddAgent Options:
  --agent-platform arg The agent platform/architecture. Available platforms:
 AIX-00F604884C00, Darwin, Linux-i686, Linux-x86_64, SunOS-i86pc, SunOS-sun4u, Win32, Win64
  --agent-name arg The agent name to be added in the system.
  --agent-logicalname arg The agent logical name (alternatively called Agent
 ID) in the environment. Makes sense only if
  --environment option is specified.
  --agent-lockerpath arg The locker path of agent.

SSH Options:
  --ssh-host arg The ssh host to connect to.
  --ssh-port arg The ssh port to connect to.
  --ssh-user arg The user to initiate ssh connection.
  --ssh-pass arg The password to initiate ssh connection.
  --ssh-destdir arg The destination dir to install the agent to.

articles