Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.
leroyjenkinsplugin edited this page Jul 30, 2014 · 27 revisions

Introduction

Leroy is a freeware software deployment engine that can be integrated into any build system. More information and documentation about Leroy is available at http://www.leroydeploy.com. The purpose of the Leroy-Jenkins plugin is to help integrate Leroy's deployment functionality and configuration management with Jenkin's presentation and access control abilities. This allows one to create a web based application deployment dashboard granting software, system and devops engineers to work together to bring automation and consistency to deployments using a simple xml format stored in SCM.

The Leroy-Jenkins plugin grants the following functionality:

  • Add/remove agents
  • Add/edit/update environments
  • SSH install agents
  • Update leroy controller
  • Generate configurations
  • Perform deployment
  • Pass parameters to deployment
  • Track what deployments occurred on which environment by whom and with which artifacts.
  • Track what workflows ran on different environments by whom and with which artifacts.
  • Configure an environment to fetch deployment config directly from scm or as last good deployment.

Installation

Setup Controller

  1. Install Leroy plugin
  2. Go into nodes and choose a node that you want to act as your controller. The controller is the staging area where the deployment occurs. Choose [X] Leroy controller and enter a path you want to install leroy. Choose the platform of your node and click update. This will automatically update / install the latest release of leroy to the target folder you specified.
  3. Add agents for each host in your first environment
  4. Add environments and place agents in each environment appropriately.
  5. Assign / create roles for each host in each environment.

Each agent has a name, id and at least one role.

  • name: A unique string identifying this agent (ex: hostname_env_runasuser)
  • id: A logical name identifying this node that is only unique to the environment (ex: web01)
  • role(s): A string used which places the agent in a group. Any role defined in an environment must be used in all environments (ex: web)

Here's an example list of agents in environments: name | id | role(s) | environment US-B-WEB01 | web01 | web | build US-B-WEB02 | web02 | web | build US-B-JBOSS01 | jboss01 | jboss | build US-B-JBOSS02 | jboss02 | jboss | build US-B-db01 | db01 | db | build

US-D-WEB01 | web01 | web | dev US-D-WEB02 | web02 | web | dev US-D-JBOSS01 | jboss01 | jboss | dev US-D-JBOSS02 | jboss02 | jboss | dev US-D-db01 | db01 | db | build US-D-db02 | db02 | db | build

Check Leroy project into SCM

  1. Create the following folders: commands, workflows, properties, resources
  2. Create file: commands/test.sh or command/test.bat inside put: echo this works!
  3. Create file: workflows/test.xml add: <workflow><execute command="test.sh" /></workflow>
  4. Commit files to SCM

Create new "Leroy Deployment Job"

  1. Click "New Item"
  2. Enter: item name
  3. Choose: "Leroy Deployment Job"
  4. Under "Source Code Management" enter the location where you committed your files to your SCM. Save the job and reload the configurations page.
  5. You should see workflow test and environments listed in "Leroy Target Configurations", choose the workflow and environment you just created, click save.
  6. Ensure that agents are running on each of the hosts in your environment. zip bundles for each agent are created on the node in LEROY_HOME/ for each agent you've created. SSH install will copy these files for you but does not start the agent, nor ensure it runs on boot. You'll have to do this on your own for now.
  7. Deploy

Usage

Clone this wiki locally