Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Groovy script can be written for many configuration values on specific step or gate. Additionally, gate or step can be skipped by providing Precondition groovy script as well. All such groovy script has access to various variables and methods listed below on this page. For some samples of such scripts, see Groovy Script Examples.

Additionally, you can find the JavaDoc for the necessary classes here: https://flexagon.com/function-sdk/7.0/

FlexDeploy allows for finding such variables and methods using suggestions in the Groovy Editor.

...

Info

Pipeline Groovy Logging

LOG function methods are available with FlexDeploy 7.0. This should be used instead of any other logging utilities (java logger, System.out etc.) for Pipeline Groovy scripts. LOG functions handle hiding secret values within logs. By default, the logging level will be based on the global FlexDeploy logging level. This can be modified specifically for groovy script logs by setting the logging level for flexagonof flexagon.fd.services.groovy.functions.LogFunctions in Administration → Admin Operations.

...

Method

Description

stgexec.getEnvironmentCode()

returns environment code

e.g. "DEV"

stgexec.getReleaseName()

returns the name of the release

e.g "December Release"

stgexec.getSnapshotName()

returns the name of the snapshot

e.g. 12-04-2019 16:21:18

stgexec.getProjectStageExecution(projectId, packageName)

returns ProjectStageExecution object for given a project id and package name. Both project id and package name must match.

stgexec.getProjectStageExecution(projectName, packageName)

returns ProjectStageExecution object for given a project name and package name. Both project name and package name must match.

stgexec.getSnapshotProjects()

returns list of ReleaseProjectVersion objects in the snapshot.

stgexec.getSnapshotProjectsAsString()

returns all projects in snapshot concatenated in the format "ProjectName,PartialProjectName (PackageName),..."

stgexec.getSnapshotDeployedProjects()

returns list of ReleaseProjectVersion objects in the snapshot which were deployed successfully.

stgexec.getSnapshotDeployedProjectsAsString()

returns all successfully deployed projects concatenated in the format "ProjectName,PartialProjectName (PackageName),..."

stgexec.getSnapshotFailedProjects()

returns list of ReleaseProjectVersion objects in the snapshot which failed to deploy.

stgexec.getSnapshotFailedProjectsAsString()

returns all failed projects concatenated in the format "ProjectName,PartialProjectName (PackageName),..."

stgexec.getSnapshotSkippedProjects()

returns list of ReleaseProjectVersion objects in the snapshot which were skipped.

stgexec.getSnapshotSkippedProjectsAsString()

returns all skipped projects concatenated in the format "ProjectName,PartialProjectName (PackageName),..."

stgexec.getSnapshotNotAttemptedProjects()

returns list of ReleaseProjectVersion objects in the snapshot which were not attempted.

stgexec.getSnapshotNotAttemptedProjectsAsString()

returns all not attempted projects concatenated in the format "ProjectName,PartialProjectName (PackageName),..."

stgexec.isAnyDeployFailed()

returns true if any projects failed to deploy or submit.

stgexec.isAnyDeployFailed(groupName)

returns true if any projects in a specific group of projects failed to deploy or submit.

returns false if the group doesn't exist or if the group doesn't have any failed project deployments.

stgexec.isAnyDeployOrUtilityFailed()

returns true if any deploy or utility workflows failed.

stgexec.isAnyDeployOrUtilityFailed(groupName)

returns true if any deploy or utility workflows in a specific group failed.

returns false if the group doesn't exist or if the group doesn't have any failed projects.

stgexec.isAnyUtilityFailed()

returns true if any utility workflows failed.

stgexec.isAnyUtilityFailed(groupName)

returns true if any utility workflows in a specific group failed.

returns false if the group doesn't exist or if the group doesn't have any failed utility projects.

stgexec.isProjectDeployed(projectId)

returns true only if project was deployed successfully. If partial deployment project, then if any package failed, this will return false, but if some packages were skipped and some deployed successfully this will still return true.

stgexec.isProjectDeployed(projectId, packageName)

returns true if a project is deployed, given the project id and package name. If package name is not supplied, this will behave same as stgexec.isProjectDeployed(projectId) method.

stgexec.isProjectDeployed(projectName)

returns true only if project was deployed successfully. If partial deployment project, then if any package failed, this will return false, but if some packages were skipped and some deployed successfully this will still return true.

stgexec.isProjectDeployed(projectName, packageName)

returns true if a project is deployed, given the project name and package name. If package name is not supplied, this will behave same as stgexec.isProjectDeployed(projectName) method.

stgexec.isProjectFailed(projectId)

returns true if a project failed to deploy or submit. if skipped or not attempted, this will return false. If partial deployment project, then if any package failed, this will return true.

stgexec.isProjectFailed(projectId, packageName)

returns true if a project failed to deploy, given the project id and package name. If package name is not supplied, this will behave same as stgexec.isProjectFailed(projectId).

stgexec.isProjectFailed(projectName)

returns true if a project failed to deploy or submit. if skipped or not attempted, this will return false. If partial deployment project, then if any package failed, this will return true.

stgexec.isProjectFailed(projectName, packageName)

returns true if a project failed to deploy, given the project name and package name. If package name is not supplied, this will behave same as stgexec.isProjectFailed(projectName).

stgexec.isProjectSkipped(projectId)

returns true if project is skipped. If partial deployment project, then if any package is skipped, this method will return true.

stgexec.isProjectSkipped(projectId, packageName)

returns true if a project is skipped, given the project id and package name. If package name is not supplied then this method will behave same as stgexec.isProjectSkipped(projectId).

stgexec.isProjectSkipped(projectName)

returns true if project is skipped. If partial deployment project, then if any package is skipped, this method will return true.

stgexec.isProjectSkipped(projectName, packageName)

returns true if a project is skipped, given the project name and package name. If package name is not supplied then this method will behave same as stgexec.isProjectSkipped(projectName).

stgexec.isProjectNotAttempted(projectId)

returns true if project was not attempted. If partial deployment project, then if any package is not attempted, this method will return true.

stgexec.isProjectNotAttempted(projectId, packageName)

returns true if a project was not attempted, given the project id and package name. If package name is not supplied then this method will behave same as stgexec.isProjectNotAttempted(projectId).

stgexec.isProjectNotAttempted(projectName)

returns true if project was not attempted. If partial deployment project, then if any package is not attempted, this method will return true.

stgexec.isProjectNotAttempted(projectName, packageName)

returns true if a project was not attempted, given the project name and package name. If package name is not supplied then this method will behave same as stgexec.isProjectNotAttempted(projectName).

stgexec.getGateStatus(gateName)

returns gate status String, "SUCCESSFUL", "RUNNING", "FAILED" or null if the gate name doesn't match or doesn't yet have a status.

note that Skipped steps that were FAILED will still return FAILED.

If an invalid gate name is given or the gate hasn't run yet, the status will be null.

isGateSuccessful(gateName)

returns true if gate status is SUCCESSFUL.

isGateFailed(gateName)

returns true if gate status is FAILED.

isGateSkipped(gateName)

returns true if gate status is PRECOND_SKIPPED.

isAnyGateFailed()

returns true if any gate failed.

isAnyGateSkipped()

returns true if any gate was skipped.

stgexec.getStepStatus(stepName)

returns step status String, "SUCCESSFUL", "RUNNING", "FAILED" or null if the gate name doesn't match or doesn't yet have a status.

If an invalid step name is given or the step hasn't run yet, the status will be null.

isStepSuccessful(stepName)

returns true if step status is SUCCESSFUL.

isStepFailed(stepName)

returns true if step status is FAILED.

isStepSkipped(stepName)

returns true if step status is PRECOND_SKIPPED.

isAnyStepFailed()

returns true if any step failed.

isAnyStepSkipped()

return true if any step was skipped.

stgexec.getProjectWorkflowOutputValues(outputName)

returns an array of deploy workflow output values with the given output name irrespective of project.

e.g. [1234123]

Note that any encrypted workflow outputs will return as "******"

stgexec.getProjectWorkflowOutputValues(projectName, outputName)

returns an array of deploy workflow output values with the given output name for the given project name.

e.g. [1234123]

Note that any encrypted workflow outputs will return as "******"

stgexec.getProjectWorkflowOutputMap(projectId)

returns a map of deploy workflow output values for the given project id. Key of map is output name and value is list of output values.

e.g. [OP1:[1,3], ENCOP2:[******, ******], BOP3:[false], DBOP4:[123.456], INOP5:[1234,123]]

Note that any encrypted workflow outputs will return as "******"

stgexec.getProjectWorkflowOutputMap(projectName)

returns a map of deploy workflow output values for the given project name. Key of map is output name and value is list of output values.

e.g. [OP1:[1,3], ENCOP2:[******, ******], BOP3:[false], DBOP4:[123.456], INOP5:[1234,123]]

Note that any encrypted workflow outputs will return as "******"

stgexec.getProjectBuildWorkflowOutputValues(outputName)

returns an array of build output values with the given output name irrespective of project.

e.g. [1234123]

Note that any encrypted workflow outputs will return as "******"

stgexec.getProjectBuildWorkflowOutputValues(projectName, outputName)

returns an array of build output values with the given output name for the given project name.

e.g. [1234123]

Note that any encrypted workflow outputs will return as "******"

stgexec.getProjectBuildWorkflowOutputMap(projectId)

returns a map of build output values for the given project id. Key of map is output name and value is list of output values.

e.g. [OP1:[1,3], ENCOP2:[******, ******], BOP3:[false], DBOP4:[123.456], INOP5:[1234,123]]

Note that any encrypted workflow outputs will return as "******"

Pass projectId as 12345 or new Long(12345).

stgexec.getProjectBuildWorkflowOutputMap(projectName)

returns a map of build output values for the given project name. Key of map is output name and value is list of output values.

e.g. [OP1:[1,3], ENCOP2:[******, ******], BOP3:[false], DBOP4:[123.456], INOP5:[1234,123]]

Note that any encrypted workflow outputs will return as "******"

stgexec.getProjectBuildWorkflowInputValues(inputName)

returns an array of build input values with the given input name irrespective of project.

e.g. [1234123]

Note that any encrypted workflow inputs will return as "******"

stgexec.getProjectBuildWorkflowInputValues(projectName, inputName)

returns an array of build input values with the given input name for the given project name.

e.g. [1234123]

Note that any encrypted workflow inputs will return as "******"

stgexec.getProjectBuildWorkflowInputMap(projectId)

returns a map of build input values for the given project id. Key of map is input name and value is list of input values.

e.g. [OP1:[1,3], ENCOP2:[******, ******], BOP3:[false], DBOP4:[123.456], INOP5:[1234,123]]

Note that any encrypted workflow inputs will return as "******"

Pass projectId as 12345 or new Long(12345).

stgexec.getProjectBuildWorkflowInputMap(projectName)

returns a map of build input values for the given project name. Key of map is input name and value is list of input values.

e.g. [OP1:[1,3], ENCOP2:[******, ******], BOP3:[false], DBOP4:[123.456], INOP5:[1234,123]]

Note that any encrypted workflow inputs will return as "******"

stgexec.getProjectBuildWorkflowFlexfieldValues(flexfieldName)

returns an array of build flexfield values with the given flexfield name irrespective of project.

e.g. [1234123]

Note that any encrypted workflow flexfields will return as "******"

stgexec.getProjectBuildWorkflowFlexfieldValues(projectName, flexfieldName)

returns an array of build flexfield values with the given flexfield name for the given project name.

e.g. [1234123]

Note that any encrypted workflow flexfields will return as "******"

stgexec.getProjectBuildWorkflowFlexfieldMap(projectId)

returns a map of build flexfield values for the given project id. Key of map is flexfield name and value is list of flexfield values.

e.g. [OP1:[1,3], ENCOP2:[******, ******], BOP3:[false], DBOP4:[123.456], INOP5:[1234,123]]

Note that any encrypted workflow flexfields will return as "******"

Pass projectId as 12345 or new Long(12345).

stgexec.getProjectBuildWorkflowFlexfieldMap(projectName)

returns a map of build flexfield values for the given project name. Key of map is flexfield name and value is list of flexfield values.

e.g. [OP1:[1,3], ENCOP2:[******, ******], BOP3:[false], DBOP4:[123.456], INOP5:[1234,123]]

Note that any encrypted workflow flexfields will return as "******"

stgexec.getGateTaskUserInfo(gateName)

Returns TaskUserInfo object for a given Manual or Externa gate  name.

stgexec.getStepTaskUserInfo(stepName)

Returns TaskUserInfo object for a given Manual task step name.

...

Method

Description

topology.getInstanceProperties(instanceCode)

returns a Map<String, Object> containing all the properties for the integration account matching the passed target group code. Key of map is a property code and value is the primitive value for that property.

e.g. Git SCM Account [FDGIT_URL: https://github.com/flexagon9/flextest.git, FDGIT_USER: flexagon9, FDGIT_PASSWORD: password123, FDGIT_TIMEOUT: null]

topology.getMappedInstances()

returns list of target group codes that are mapped to current stage(environment)

topology.isMappedToCurrentEnvironment(instanceCode)

returns true or false to indicate whether provided target group code is mapped to current stage(environment)

...