- 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
Templating in the XL Deploy Generic plugin
When you define and use configuration items (CIs) with the Generic Model plugin, you may need to use variables in certain CI properties and scripts. For example, this is how you can include properties from the deployment itself, such as the names or locations of files in the deployment package. XL Deploy uses the FreeMarker templating engine for this.
When performing a deployment using the Generic Model plugin, all CIs and scripts are processed in FreeMarker. This means that you can use placeholders in CI properties and scripts to make them more flexible. FreeMarker resolves placeholders using a context, which is a set of objects defining the template’s environment. This context depends on the type of CI being deployed.
For all CIs, the context variable step
refers to the current step object. You can use the context variable statics
to access static methods on any class. See the section on accessing static methods in the FreeMarker manual.
Deployed CIs
For deployed CIs, the context variable deployed
refers to the current CI instance. For example:
<type type="tc.DeployedDataSource" extends="generic.ProcessedTemplate" deployable-type="tc.DataSource"
container-type="tc.Server">
...
<property name="targetFile" default="${deployed.name}-ds.xml" hidden="true"/>
...
</type>
Additionally, when performing a MODIFY
operation, the context variable previousDeployed
refers to the previous version of the current CI instance. For example:
#!/bin/sh
echo "Uninstalling ${previousDeployed.name}"
rm ${deployed.container.home}/${previousDeployed.name}
echo "Installing ${deployed.name}"
cp ${deployed.file} ${deployed.container.home}
Container CIs
For container CIs, the context variable container
refers to the current container instance. For example:
<type type="tc.Server" extends="generic.Container">
<property name="home" default="/tmp/tomcat"/>
<property name="targetDirectory" default="${container.home}/webapps" hidden="true"/>
</type>
Referring to an artifact
A special case is when referring to an artifact in a placeholder. For example, when deploying a CI representing a WAR file, the following placeholder can be used to refer to that file (assuming there is a file
property on the deployable):
${deployed.file}
In this case, XL Deploy will copy the referred artifact to the target container so that the file is available to the executing script. A script containing a command like the following would therefore copy the file represented by the deployable to its installation path on the remote machine:
cp ${deployed.file} /install/path
File-related placeholders
Placeholder | Description | Example |
---|---|---|
${deployed.file} |
Complete path of the uploaded file | /tmp/ot-12345/generic_plugin.tmp/PetClinic-1.0.ear |
${deployed.deployable.file} |
Complete path of the uploaded deployable file (no placeholder replacement) | /tmp/ot-12345/generic_plugin.tmp/PetClinic-1.0.ear |
Deployment plan steps
The following placeholders are available for deployment plan steps:
Placeholder | Description |
---|---|
${step.uploadedArtifactPath} |
Path of the uploaded artifact |
${step.hostFileSeparator} |
File separator; depends on the operating system of the target machine |
${step.localConnection} |
Name of the local connection |
${step.retainRemoteWorkingDirOnCompletion} |
Whether to leave the working directory after the action is completed |
${step.hostLineSeparator} |
Line separator; depends on the operating system of the target machine |
${step.scriptTemplatePath} |
Path to the FreeMarker template |
${step.class} |
Step Java class |
${step.preview} |
Preview of the step |
${step.remoteWorkingDirPath} |
Path of the remote working directory |
${step.remoteConnection} |
Name of the remote connection |
${step.scriptPath} |
Path of the script |
${step.artifact} |
Artifact to be uploaded |
${step.remoteWorkingDirectory} |
Remote working directory name |
Accessing the ExecutionContext
In XL Deploy 4.5.3 and later, the Generic plugin can access the ExecutionContext and use it in a FreeMarker template. For example:
<type type="demo.DeployedStuff" extends="generic.ExecutedScript" deployable-type="demo.Stuff" container-type="overthere.SshHost">
<generate-deployable type="demo.Stuff" extends="generic.Resource"/>
<property name="P1" default="X"/>
<property name="P2" default="Y"/>
<property name="P3" default="Z"/>
<property name="createScript" default="stuff/create" hidden="true"/>
</type>
Sample FreeMarker template:
echo "${deployed.P1}"
echo "${deployed.P2}"
echo "${deployed.P3}"
echo "${context}"
echo "${context.getClass()}"
echo "${context.getTask().getId()}"
echo "${context.getTask().getUsername()}"
echo "display metadata"
<#list context.getTask().getMetadata()?keys as k>
echo "${k} = ${context.getTask().getMetadata()[k]}"
</#list>
echo "/display metadata"