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.
FlexDeploy version 5.2.0.3 allows for finding such variables and methods using Variable Lookup help. Prior versions allowed such help with use of drop-down next to script input.
Variable | Description |
---|---|
ReleaseName | Name of the release provided when created |
SnapshotName | Name of the snapshot (auto generated by date and time when created) |
SnapshotDuplicateFilesFlag | True if there are duplicate files in the snapshot |
SnapshotDescription | Description of the snapshot |
StageExecutionId | ID of the execution |
PipelineDefinitionId | Pipeline Id. |
PipelineName | Pipeline name. |
stgexec | Allows access to execution details for Gate, Step, Deploy or Utility workflows. This variable was previously called FD_Release, which will continue to work but is deprecated now. |
stgexecinfo | Allows access to details entered by user on Stage Execution Info. It will not show any default values or FlexFields or WorkFlowInputs that are not set in the Stage Execution Info popup (The Paper Clip on the release dashboard screen) added in 5.2.0.3 |
Methods for stgexec variable.
Method | Description |
---|---|
stgexec.areAllUtilitySuccessful() | returns true if all utility workflows were successful |
stgexec.areAllUtilitySuccessful(groupName) | returns true if all utility workflows in a specific group were successful |
stgexec.getEnvironmentCode() | returns environment code e.g. "DEV" |
stgexec.getReleaseName() | returns the name of the release e.g "December Release" |
stgexec.getProjectStageExecution(projectId, packageName) | returns ProjectStageExecution given a project ID and package name |
stgexec.getProjectStageExecution(projectName, packageName) | returns ProjectStageExecution given a project name and package name |
stgexec.getSnapshotName() | returns the name of the snapshot e.g. 12-04-2019 16:21:18 |
stgexec.getSnapshotProjects() | returns the projects in the snapshot e.g. [flexagon.fd.model.appmodules.helpers.release.pojo.ReleaseProjectVersion@6711b68e, Project Name[MobileApp], Version Id[936985], Deploy Priority[3]] |
stgexec.getSnapshotProjectsAsString() | returns all project names in snapshot concatenated in the format "ProjectName, PartialProjectName (PackageName), ..." |
stgexec.getSnapshotDeployedProjects() | returns the projects in the snapshot which were deployed e.g. [flexagon.fd.model.appmodules.helpers.release.pojo.ReleaseProjectVersion@6711b68e, Project Name[MobileApp], Version Id[936985], Deploy Priority[3]] |
stgexec.getSnapshotDeployedProjectsAsString() | returns all deployed project names in snapshot concatenated in the format "ProjectName, PartialProjectName (PackageName), ..." |
stgexec.getSnapshotFailedProjects() | returns the projects in the snapshot which failed to deploy e.g. [flexagon.fd.model.appmodules.helpers.release.pojo.ReleaseProjectVersion@6711b68e, Project Name[MobileApp], Version Id[936985], Deploy Priority[3]] |
stgexec.getSnapshotFailedProjectsAsString() | returns all failed project names in snapshot concatenated in the format "ProjectName, PartialProjectName (PackageName), ..." |
stgexec.getSnapshotSkippedProjects() | returns the projects in the snapshot which were skipped e.g. [flexagon.fd.model.appmodules.helpers.release.pojo.ReleaseProjectVersion@6711b68e, Project Name[MobileApp], Version Id[936985], Deploy Priority[3]] |
stgexec.getSnapshotSkippedProjectsAsString() | returns all skipped project names in snapshot concatenated in the format "ProjectName, PartialProjectName (PackageName), ..." |
stgexec.getSnapshotNotAttemptedProjects() | returns the projects in the snapshot which were not attempted e.g. [flexagon.fd.model.appmodules.helpers.release.pojo.ReleaseProjectVersion@6711b68e, Project Name[MobileApp], Version Id[936985], Deploy Priority[3]] |
stgexec.getSnapshotNotAttemptedProjectsAsString() | returns all not attempted project names in snapshot concatenated in the format "ProjectName, PartialProjectName (PackageName), ..." |
stgexec.isAnyDeployFailed() | returns true if any projects failed to deploy |
stgexec.isAnyDeployFailed(groupName) | returns true if any projects in a specific group of projects failed to deploy 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 projects or utility workflows failed |
stgexec.isAnyDeployOrUtilityFailed(groupName) | returns true if any projects 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, packageName) | returns true if a project is deployed, given the project ID and package name If working with a full-deploy project without a package name, pass in null for the package name. |
stgexec.isProjectDeployed(projectName, packageName) | returns true if a project is deployed, given the project name and package name If working with a full-deploy project without a package name, pass in null for the package name. |
stgexec.isProjectFailed(projectId, packageName) | returns true if a project failed to deploy, given the project ID and package name If working with a full-deploy project without a package name, pass in null for the package name. |
stgexec.isProjectFailed(projectName, packageName) | returns true if a project failed to deploy, given the project name and package name If working with a full-deploy project without a package name, pass in null for the package name. |
stgexec.isProjectSkipped(projectId, packageName) | returns true if a project is skipped, given the project ID and package name If working with a full-deploy project without a package name, pass in null for the package name. |
stgexec.isProjectSkipped(projectName, packageName) | returns true if a project is skipped, given the project name and package name If working with a full-deploy project without a package name, pass in null for the package name. |
stgexec.isProjectNotAttempted(projectId, packageName) | returns true if a project was not attempted, given the project ID and package name If working with a full-deploy project without a package name, pass in null for the package name. |
stgexec.isProjectNotAttempted(projectName, packageName) | returns true if a project was not attempted, given the project name and package name. If working with a full-deploy project without a package name, pass in null for the package name. |
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. |
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. |
stgexec.getProjectWorkflowOutputValues(outputName) | returns an array of output values with the given output name. e.g. [1234123] Note that any encrypted workflow outputs will return as "******" |
stgexec.getProjectWorkflowOutputValues(projectName, outputName) | returns an array of 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 output values with the given output name for the given project id. e.g. [asdfout:[asdfout], encout:[******, ******], falser:[false], dblout:[123.456], truer:[true], intout:[1234123]] Note that any encrypted workflow outputs will return as "******" |
stgexec.getProjectWorkflowOutputMap(projectName) | returns a map of output values with the given output name for the given project name. e.g. [asdfout:[asdfout], encout:[******], falser:[false], dblout:[123.456], truer:[true], intout:[1234123]] Note that any encrypted workflow outputs will return as "******" |