XebiaLabs | Continuous Delivery and Agile DevOps Tools

XebiaLabs Blog

Subscribe to XebiaLabs Blog: eMailAlertsEmail Alerts
Get XebiaLabs Blog via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Related Topics: Continuous Integration, DevOps for Business Application Services, DevOps Journal

Blog Post

Compute Property Values with Rules By @XebiaLabs | @DevOpsSummit [#DevOps]

Define a rule that performs the computation using a pre-plan processor and a python script:

Compute Property Values with Rules

By Benoit Moussaud

A quick tip I used to help a customer. They’ve defined two extra properties on their host to help them to compute container’s properties (eg home). It works fine for the generic-plugin based middleware

(eg tomcat.home = ”${container.host.envRootPath} / var / wildfly / $ {container.instanceId}”)

but not for other plugins based not based on the generic plugin (eg. jboss/wildfly or Websphere plugin).

My first answer was to create a cli script that performs the computation and update the configuration items according to the expected definition but the Ops team needs to switch to another tools.

My next answer was to define a control task that can called from the UI but typically the ‘repositoryService‘ is not injected in the script’s context: impossible to update the configuration item’s values.

So I found out the following solution: define a rule that perform the computation using a pre-plan processor and a python script:

<rule name="compute.jboss.home.context" scope="pre-plan">

And the python script ‘compute/jbosshome.py’ is :

def jboss_containers():
return filter(lambda ci: str(ci.type) == 'jbossdm.StandaloneServer',

for container in jboss_containers():
if not container.home.startswith('/'):
print "---- processing %s " % container
print "processing host %s " % container.host
home = "%s/var/wildfly/wf-%s" % (container.host.envRootPath, container.host.envCode)
container.home = home
repositoryService.update(container.id, container)

The main advantage: no need to think to trigger any extra commands or control tasks: the computation is performed during the planning phase executed when XLDeploy generates the deployment tasks.

xl-rules rulez !!!

The post Compute Property Values With Rules appeared first on XebiaLabs.

Related posts:


XL Rules: Custom Integrations With XL Deploy Rules Framework

Deploying with Dojo and JavaScript

LOGO XL_Deploy2.fw

XL Deploy Variables Demystified : Part 1

Read the original blog entry...

More Stories By XebiaLabs Blog

XebiaLabs is the technology leader for automation software for DevOps and Continuous Delivery. It focuses on helping companies accelerate the delivery of new software in the most efficient manner. Its products are simple to use, quick to implement, and provide robust enterprise technology.