- 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
Using variables and expressions in FreeMarker templates
XL Deploy uses the FreeMarker templating engine to allow you to access deployment properties such as such as the names or locations of files in the deployment package.
For example, when using rules to customize a deployment plan, you can invoke a FreeMarker template from an os-script
or template
step. Also, you can use FreeMarker templates with the Java-based Generic plugin, or with a custom plugin that is based on the Generic plugin.
Variables that are available
The data that is available for you to use in a FreeMarker template depends on when and where the template will be used.
- Objects and properties available to rules describes the objects that are available for you to use in rules with different scopes
- The Steps Reference describes the predefined steps that you can invoke using rules
- The UDM CI reference describes the properties of the objects that you can access
- The Jython API documentation describes the services that you can access
Expressions that are available
The XL Deploy FreeMarker processor can handle special characters in variable values by sanitizing them for Microsoft Windows and Unix. The processor will automatically detect and sanitize variables for each operating system if the FreeMarker template ends with the correct extension:
- For Windows:
.bat.ftl
,.cmd.ftl
,.bat
,.cmd
- For Unix:
.sh.ftl
,.sh
It uses the ${sanitize(password)}
expression to do so (where password
is an example of a variable name). If the extension is not matched, then the processor will not modify the variable.
When auto-detection based on the file extension is not possible, you can use the following expressions to sanitize variables for each operating system:
${sanitizeForWindows(password)}
${sanitizeForUnix(password)}
Where password
is an example of a variable name.
This functionality is supported as of XL Deploy 4.5.9, 5.0.8, 5.1.4, and 5.5.0.
Accessing dictionary values in a FreeMarker template
It can often be helpful to access dictionary entries from within FreeMarker template; for example, to send an email that contains all dictionaries and their values after a successful deployment. You can access a dictionary and its properties using following access path in your FreeMarker template:
deployedApplication
→environment
→dictionaries
→dictionary
→name
(String)deployedApplication
→environment
→dictionaries
→dictionary
→type
(String)deployedApplication
→environment
→dictionaries
→dictionary
→entries
(Map[String, String])
The name
and type
are straightforward to reference while iterating through a list of dictionaries. The entries
property is a map of string values, so you need a FreeMarker directive to print it. The following example iterates through every dictionary associated with a deployed application and prints its name, type (dictionary
or encryptedDictionary
), and entries.
<#list deployedApplication.environment.dictionaries as dict>
Dictionary: ${dict.name} (${dict.type})
Values:
<#list dict.entries?keys as key>
${key} = ${dict.entries[key]}
</#list>
</#list>
Note that the deployedApplication
object may not be available by default in FreeMarker template, but you can add it using your rule step configuration as in the following example:
<os-script>
<script>...</script>
<freemarker-context>
<deployedApplication expression="true">deployedApplication</deployedApplication>
</freemarker-context>
</os-script>