mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-02-07 13:42:23 +02:00
* checkChangeInDevelopment to GO - add groovy step isChangeInDevelopment - direct to new Groovy - direct to GO
2.3 KiB
2.3 KiB
${docGenStepName}
${docGenDescription}
Prerequisites
- You have an SAP Solution Manager user to which you have assigned the roles required for uploading. See SAP Solution Manager Administration.
- You have created a change document.
- You have installed the Change Management Client with the needed certificates. See Change Management Client.
Specifying the Change Document
The target of the status check is a change document identified by an identifier (ID).
Specify the ID by step parameter or common pipeline environment.
Return Value
The step isChangeInDevelopment
returns a boolean value by setting the custom key
custom.isChangeInDevelopment
of the common pipeline environment:
-
true
if the change document is in statusin development
. -
false
if the change document is not in statusin development
. In this case,AbortException
terminates the execution of the pipeline job.
// pipeline script
isChangeInDevelopment( script: this )
...
You can omit this exception by setting the configuration parameter failIfStatusIsNotInDevelopment
to false
:
// pipeline script
isChangeInDevelopment( script: this, failIfStatusIsNotInDevelopment: false )
if(commonPipelineEnvironment.getValue( 'isChangeInDevelopment' ) {
...
}
${docGenParameters}
${docGenConfiguration}
${docJenkinsPluginDependencies}
Examples
# config.yaml
general:
changeManagement:
credentialsId: 'SOLMAN_CRED_ID'
endpoint: 'https://example.org/cm/solman/endpoint'
steps:
isChangeInDevelopment:
dockerImage: 'ppiper/cm-client'
transportRequestUploadSOLMAN:
dockerImage: 'ppiper/cm-client'
applicationId: 'APPID',
filePath: '/path/file.ext',
// pipeline script
...
stage('Upload') {
transportRequestDocIDFromGit( script: this )
isChangeInDevelopment( script: this )
transportRequestReqIDFromGit( script: this )
transportRequestUploadSOLMAN( script: this )
}