- 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
Valid since:
XL Release 6.1.0
Create a Groovy Script task
A Groovy Script task contains a Groovy script that is executed on the XL Release server. This is an automated task that completes when the script finishes successfully.
As of XL Release version 7.5.0, the inline script editor is used to enter script. Type or paste a Groovy script into the Script field of the Groovy script task details. To enlarge the script editor, click . Pressing this button again will minimize the editor.
Note: The output of the remote script task is in markdown format. For more information, refer to Using Markdown in XL Release.
In the release flow editor, Groovy Script tasks have a gray border.
Variables and public API access
You can access releaseVariables
and globalVariables
from a script, which gives you the same set of API services that are available for the Jython Script task type. You can use releaseVariables
and globalVariables
in a script, in addition to the release-as-code API.
You cannot use the XL Release-style ${myReleaseVar}
expression in a Groovy Script task because it is a valid syntax of the Groovy language. This means that XL Release does not support variable interpolation for Groovy Script tasks (however, you can use this syntax in Jython Scrip tasks).
For example:
def server(type, title) {
def cis = configurationApi.searchByTypeAndTitle(type, title)
if (cis.isEmpty()) {
throw new RuntimeException("No CI found for the Type and Title")
}
if (cis.size() > 1) {
throw new RuntimeException("More than one CI found for the Type and Title")
}
cis.get(0)
}
def globVar = globalVariables['global.globalVariable']
def myReleaseVar = releaseVariables['myReleaseVar']
Security and Groovy Script tasks
When a Groovy Script task becomes active, the script is executed in a sandbox environment on the XL Release server. This means that the script has very restricted permissions. By default, access to the file system, network, and non API related classes is not allowed.
To remove these restrictions, add a script.policy
file to the XL_RELEASE_SERVER_HOME/conf
directory.
This is a standard Java Security Policy file that contains the permissions that a script should have.
To enable the use of additional Java packages or classes in the script, use the following XL Release specific RuntimePermission
:
permission com.xebialabs.xlrelease.script.security.RuntimePermission "accessClass.com.company.domain.*";
permission com.xebialabs.xlrelease.script.security.RuntimePermission "accessClass.com.company.utils.HelperClass";
You must restart the XL Release server after creating or changing the XL_RELEASE_SERVER_HOME/conf/script.policy
file.
Sample script
This sample script creates a release containing one Manual task:
xlr {
release("Sample release with a Manual task") {
description "Sample template created from Groovy DSL"
phases {
phase {
title "Sample"
tasks {
manual("Manual task") {
description "Manual task description"
}
}
}
}
}
}