Summary
The Groovy plug-in automates running a Groovy script as a process step. This plug-in is installed as part of HCL DevOps Deploy (Launch).
This plug-in includes one step.
Installation
No special steps are required for installation. This plug-in is included with the installation of HCL DevOps Deploy. If you must install the plug-in again, see Installing plug-ins in HCL Deploy products.
Usage
You can use the Groovy plug-in to run Groovy scripts as HCL DevOps Deploy (Launch) process steps. See the Groovy website for information about creating a Groovy script.
Step Palette
To access this plug-in in the palette, click Scripting.
Examples
You can use this plug-in to create a simple or complex step. For example, the following script obtains the date and time, formats that data, and passes it into an output variable named date. The output variable can be used in a later process step.
import java.text.SimpleDateFormat
def today = new Date()
def formattedDate = new SimpleDateFormat("yyyy-MM-dd\_hh-mm-ss").format(today)
println "Setting output property 'date' to '$formattedDate'"
println "Access the time stamp in later steps using \``${p:NameOfThisStep/date}``"
outProps.put("date",formattedDate)
Steps
Process step in the Groovy plug-in:
Run Groovy Script
This step runs a groovy script
Name |
Type |
Description |
Required |
Groovy Home |
String |
The Groovy home directory. The default value is the GROOVY_HOME environment variable. |
Yes |
Script |
String |
The Groovy script code to run. Use thejava.util.Properties Java variable, outProps to upload output properties to the server, and the inProps variable to contain all input properties. |
Yes |
ClassPath |
String |
List the classpaths to include. Separate multiple classpaths using commas or new lines. |
No |