Plug-in Documentation

Groovy

Overview

The Groovy plug-in automates running a Groovy script as a process step. This plug-in is installed as part of IBM UrbanCode Deploy.

This plug-in includes one step.

Compatibility

This plug-in requires UrbanCode Deploy version 6.0 or later.

This plug-in runs on all operating systems that UrbanCode Deploy supports.

Installation

No special steps are required for installation. This plug-in is included with the installation of IBM UrbanCode Deploy. If you must install the plug-in again, see Installing plug-ins in UrbanCode products.

History

Version 10

  • Added Shutdown Hook to ensure Output Properties are set on script exit.
  • If Shutdown Hooks exist in your Groovy scripts, there may be conflicts or inconsistencies in Shutdown Hook order and behavior.

Version 9.863951

Support property file encryption.

Version 8

Added support for encrypted property files.

Version 7.785238

Version 7 includes translated content.

Version 6.671137

This release includes a fix for a defect that is related to running Groovy on Microsoft Windows.

Usage

You can use the Groovy plug-in to run Groovy scripts as IBM UrbanCode Deploy 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 that is named date. The output variable can be use 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 steps in the Groovy plug-in

Run Groovy Script

This step runs a groovy script.

Input properties for the Run Groovy Script step
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 the java.util.Properties Java variable, outProps to upload output properties to the server and the inProps variable to contain all input properties. Yes