- Docs Home
- Getting started
- XL Release
- Overview
- Installation
- Get started with XL Release
- Manage your installation
- Model your releases
- Release your software
- Release overview
- Create and start releases
- Configure release properties
- Schedule releases
- Start a release from an archived release
- Start a release from a template
- Start a release from another release
- Create a release from a Git repository
- Add a phase to a release or template
- Add a task to a phase in a release or template
- Import a release template
- Trigger releases
- Work with running releases
- Work with plugins
- Using reports
- Customize XL Release
- API and scripting overview
- Create custom task types
- Create custom configuration types
- Create custom trigger types
- Extend the XL Release GUI
- Declare custom REST endpoints
- Create custom tiles
- Create custom task types
- Create custom configuration types
- Using scheduling in scripts to connect to long running jobs
- Implement a custom failure handler
- Listen to XL Release events
- Configuration settings
- Release manuals
- XL Deploy
- Overview
- Installation
- Get started with XL Deploy
- Manage your installation
- Logging
- Start XL Deploy
- Shut down XL Deploy
- Back up XL Deploy
- Upgrade XL Deploy
- The XL Deploy repository
- Configure the repository
- Configure XL Deploy to fetch artifacts from a Maven repository
- Manage security
- Manage system settings
- XL Deploy configuration files
- Configure failover for XL Deploy
- High availability with master-worker setup
- Add, start, and use workers
- Configure active/hot-standby mode
- Configure the task execution engine
- Troubleshoot the Jackrabbit JCR repository
- Configure XL Deploy client settings
- Enable XL Deploy maintenance mode
- Update the XL Deploy digital certificate
- The XL Deploy work directory
- Reclaim disk space on an XL Deploy server
- Hide internal XL Deploy server errors
- Automatically purge packages according to a user-defined policy
- Automatically purge the task archive according to a user-defined policy
- Specify file encoding on the XL Deploy server
- Automatically archive tasks according to a user-defined policy
- Best practices for maintaining XebiaLabs tools
- Connect to your infrastructure
- Set up applications and environments
- Prepare your application for XL Deploy
- Create a deployment package
- Define application dependencies
- Configure an environment
- Using placeholders and dictionaries
- Working with deployment packages
- Preparing your application for XL Deploy
- Understanding deployables and deployeds
- XL Deploy manifest format
- Deprecated XL Deploy manifest format
- Using the XL Deploy Manifest Editor
- Understanding archives and folders in XL Deploy
- Add an externally stored artifact to a package
- Extend the external artifact storage feature
- Add a package to XL Deploy
- Export a deployment package
- XL Deploy for developers
- Tips and tricks for deployment packages
- Deploy an application
- Deployment overview
- Understanding the XL Deploy planning phase
- Steps and step lists in XL Deploy
- Understanding tasks in XL Deploy
- Deploy an application
- Use tags to configure deployments
- Preview the deployment plan
- Use orchestration
- Working with deployments
- Stopping, aborting, or canceling a deployment
- Schedule a deployment
- Update a deployed application
- Staging artifacts in XL Deploy
- Monitor and reassign deployment tasks
- Make previously deployed property values available in a PowerShell script
- Undeploy an application or deprovision an environment
- Perform canary deployments
- Perform dark launch deployments
- Perform hot deployments
- Deploying an externally stored artifact using the XL Deploy CLI
- Schedule or reschedule a task
- Using the deployment pipeline view
- Deploy to remote datacenters
- Get started with provisioning
- Introduction to the release dashboard
- Work with the CLI
- Work with plugins
- Create an XL Deploy plugin
- Base plugins and the deployed object
- Implement custom XL Deploy plugpoints
- Add a checkpoint to a custom plugin
- Step options for the Generic, PowerShell, and Python plugins
- Sample Java-based XL Deploy plugin
- XL Deploy plugin tutorial
- Standard plugins
- Middleware plugins
- Apache Tomcat
- BizTalk
- F5 BIG-IP
- GlassFish
- IBM WebSphere Application Server
- IBM WebSphere Process Server
- IBM WebSphere Liberty Profile Server
- IBM WebSphere MQ
- JBoss Application Server 5 and 6
- JBoss Application Server 7 and up
- Microsoft Internet Information Services
- Microsoft Windows
- NetScaler
- Oracle Service Bus
- Oracle Service-Oriented Architecture
- Oracle WebLogic Application Server
- Provisioning plugins
- Container platform plugins
- Tools
- Community plugins
- Using control tasks
- Using the explorer
- Using XL Deploy reports
- Customize XL Deploy
- Release manuals
- DevOps as Code
- Get started with DevOps as Code
- Install the XL CLI
- XL CLI command reference
- Work with the YAML format
- YAML snippets reference
- Manage values in DevOps as Code
- Track progress using XL CLI output
- Manage risk profiles
- Manage XL Deploy permissions in YAML
- Manage XL Release permissions in YAML
- Manage XL Release folder permissions in YAML
- Tutorial: Managing an XL Release template as code
- Blueprints
- API and CI references
- Plugins
- XL Release plugins
- XL Deploy plugins
- Standard plugins
- Middleware plugins
- Apache Tomcat
- BizTalk
- F5 BIG-IP
- GlassFish
- IBM WebSphere Application Server
- IBM WebSphere Process Server
- IBM WebSphere Liberty Profile Server
- IBM WebSphere MQ
- JBoss Application Server 5 and 6
- JBoss Application Server 7 and up
- Microsoft Internet Information Services
- Microsoft Windows
- NetScaler
- Oracle Service Bus
- Oracle Service-Oriented Architecture
- Oracle WebLogic Application Server
- Provisioning plugins
- Container platform plugins
- Tools
- Community plugins
- Videos
- Community
- Fix Trackers
- Archive
Create a custom validation rule
You can add validation rules to properties and configuration items (CIs) in the synthetic.xml
. Out of the box, XL Deploy comes with the regex
validation rule, which can be used to define naming conventions using regular expressions.
This XML snippet shows how to add a validation rule:
<type type="tc.WarModule" extends="ud.BaseDeployedArtifact" deployable-type="jee.War"
container-type="tc.Server">
<property name="changeTicketNumber" required="true">
<rule type="regex" pattern="^JIRA-[0-9]+$"
message="Ticket number should be of the form JIRA-[number]"/>
</property>
</type>
The validation will throw an error, when the tc.WarModule
is being saved in XL Deploy with a value that is not of the form JIRA-[number]
.
Define a validation rule in Java
You can define XL Deploy validation rules in Java. These can then be used to annotate CIs or their properties so that XL Deploy can perform validations.
This is an example of a property validation rule called static-content
that validates that a string kind field has a specific fixed value:
import com.xebialabs.deployit.plugin.api.validation.Rule;
import com.xebialabs.deployit.plugin.api.validation.ValidationContext;
import com.xebialabs.deployit.plugin.api.validation.ApplicableTo;
import com.xebialabs.deployit.plugin.api.reflect.PropertyKind;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@ApplicableTo(PropertyKind.STRING)
@Retention(RetentionPolicy.RUNTIME)
@Rule(clazz = StaticContent.Validator.class, type = "static-content")
@Target(ElementType.FIELD)
public @interface StaticContent {
String content();
public static class Validator
implements com.xebialabs.deployit.plugin.api.validation.Validator<String> {
private String content;
@Override
public void validate(String value, ValidationContext context) {
if (value != null && !value.equals(content)) {
context.error("Value should be %s but was %s", content, value);
}
}
}
}
A validation rule consists of an annotation, in this case @StaticContent
, which is associated with an implementation of com.xebialabs.deployit.plugin.api.validation.Validator<T>
. They are associated using the @com.xebialabs.deployit.plugin.api.validation.Rule
annotation. Each method of the annotation needs to be present in the validator as a property with the same name, see the content
field and property above. It is possible to limit the kinds of properties that a validation rule can be applied to by annotating it with the @ApplicableTo
annotation and providing that with the allowed property kinds.
When you’ve defined this validation rule, you can use it to annotate a CI like such:
public class MyLinuxHost extends BaseContainer {
@Property
@StaticContent(content = "/tmp")
private String temporaryDirectory;
}
Or you can use it in synthetic XML in the following way:
<type name="ext.MyLinuxHost" extends="udm.BaseContainer">
<property name="temporaryDirectory">
<rule type="static-content" content="/tmp"/>
</property>
</type>