-
Notifications
You must be signed in to change notification settings - Fork 1
Home
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, artifact storage 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.
Go: Manage Jenkins -> Manage Plugins
Click: Advanced, Upload Plugin
Choose: leroy.hpi
- Install Leroy plugin
- 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 controller". This will automatically update / install the latest release of leroy to the target folder you specified.
- Add agents for each host in your first environment
- Add environments and place agents in each environment appropriately.
- 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 | dev |
| US-D-db02 | db02 | db | dev |
- Click "New Item"
- Enter: item name
- Choose: "Leroy Deployment Job"
- Under "Source Code Management" enter the location where you committed your files to your SCM. Save the job and reload the configurations page.
Ensure you enter the proper location where you've checked in your leroy configurations:
Then save it, so the project can load the xml files from your repository:
- You should see workflow test and environments listed in "Leroy Target Configurations", choose the workflow and environment you just created, click save.
- 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.
- Deploy
Create deployment configurations to preset how you want each workflow environment combination to be executed:
Add optional deployment parameters to create modifications to how you want your deployment to behave. Parameters created here become available to Leroy as properties as: ${property} these properties can also be used inside any scripting called by leroy workflows as environment variables. Windows will see %property% in .bat and powershell files and unix will see ${property} as a shell variable, as expected.
In this example deployment we can prompt the user for a deployment password. Such things could be used to prevent accidental deployments to higher environments.





