Define a Rule
Deploy rules allow you to use XML or Jython to specify the steps that belong in a deployment plan and how the steps are configured.
You define and disable rules in
XL_DEPLOY_SERVER_HOME/ext/xl-rules.xml. Deploy plugin JAR files can also contain
xl-rules.xml file has the default namespace
xmlns="http://www.xebialabs.com/deployit/xl-rules". The root element must be
rules, under which
disable-rule elements are located.
- Must have a name that is unique across the whole system
- Must have a scope
- Must define the conditions under which it will run
- Can use the planning context to influence the resulting plan
When the Deploy server starts, it scans the
xl-rules.xml file and registers the rules.
You can configure Deploy to rescan all rules on the server whenever you change the
To do this, update the
file-watch key in the
For example, to poll every 1 second if the
xl-rules.xml file has been modified:
deploy: task: ... ... planner: file-watch: interval: 1 second ... ...
Note: As of Deploy version 8.6, the
planner.conffile is deprecated. The configuration properties from this file have been migrated to
deploy.task.plannerblock in the
deploy-task.yamlfile. For more information, see Deploy configuration files.
By default, the interval is set to 0 seconds. This means that Deploy will not automatically rescan the rules when
If Deploy is configured to automatically rescan the rules and it finds that
xl-rules.xml has been modified, it will rescan all rules in the system. By automatically reloading the rules, you can easily experiment until you are satisfied with your set of rules.
Note: If you modify the
deploy-task.yaml file, you must restart the Deploy server.