1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-02-07 13:42:23 +02:00
sap-jenkins-library/documentation/docs/steps/isChangeInDevelopment.md
Roland Stengel a0f9c3669f
isChangeInDevelopment documentation (#3140)
* checkChangeInDevelopment to GO
- add groovy step isChangeInDevelopment
- direct to new Groovy
- direct to GO
2021-10-18 15:16:22 +02:00

2.3 KiB

${docGenStepName}

${docGenDescription}

Prerequisites

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 status in development.

  • false if the change document is not in status in 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 )
   }