A groovy script can be used in custom gates and steps, as well as for many configuration values on specific steps or gates. Additionally, a gate or step can be skipped by providing a Precondition groovy script. This page includes some sample scripts for these scenarios. See Pipeline Groovy Variables and Methods for a full listing of the accessible variables and methods in these groovy scripts.
Custom Gates and Steps
...
Code Block |
---|
|
def deployedTypes = stgexec.getProjectWorkflowOutputValues("DeployedTypes");
for (String listItem : deployedTypes)
{
if (listItem.contains('OAF_JAVA'))
{
return true;
}
}
return false; |
Execute Gate only if Snapshot Projects contain a specific Project Group
This is useful when you could want technology/team specific approvals which would only make sense to do when that particular Project Group/Technology is included in the snapshot.
Code Block |
---|
|
def projectGroup = "Oracle Integrations"
return stgexec.getSnapshotProjects().findIndexOf {
projectGroup in it.getProjectGroupNames()
} != -1 |