isChangeInDevelopment¶
This step checks if a certain change is in status 'in development'
Description¶
This step checks if a certain change is in status 'in development'
Usage¶
We recommend to define values of step parameters via .pipeline/config.yml file.
In this case, calling the step is essentially reduced to defining the step name.
Calling the step can be done either in an orchestrator specific way (e.g. via a Jenkins library step) or on the command line.
library('piper-lib-os')
isChangeInDevelopment script: this
piper isChangeInDevelopment
Outputs¶
Output type | Details |
---|---|
commonPipelineEnvironment |
|
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' ) {
...
}
Parameters¶
Overview - Step¶
Name | Mandatory | Additional information |
---|---|---|
changeDocumentId | yes | |
endpoint | yes | |
password | (yes) | pass via ENV or Jenkins credentials (credentialsId ) |
script | (yes) | reference to Jenkins main pipeline script |
username | (yes) | pass via ENV or Jenkins credentials (credentialsId ) |
cmClientOpts | no | |
failIfStatusIsNotInDevelopment | no | |
verbose | no | activates debug output |
Overview - Execution Environment¶
Orchestrator-specific only
These parameters are relevant for orchestrator usage and not considered when using the command line option.
Name | Mandatory | Additional information |
---|---|---|
containerCommand | no | |
containerShell | no | |
dockerEnvVars | no | |
dockerImage | no | |
dockerName | no | |
dockerOptions | no | |
dockerPullImage | no | |
dockerVolumeBind | no | |
dockerWorkspace | no |
Details¶
changeDocumentId¶
ID of the change document to be checked for the status
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | $PIPER_changeDocumentId (if set) |
Secret | no |
Configuration scope |
|
Resource references | commonPipelineEnvironment: reference to: custom/changeDocumentId |
cmClientOpts¶
additional options passed to cm client, e.g. for troubleshooting
Scope | Details |
---|---|
Aliases | - clientOpts - changeManagement/clientOpts |
Type | []string |
Mandatory | no |
Default | $PIPER_cmClientOpts (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
containerCommand¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Allows to specify start command for container created with dockerImage parameter to overwrite Piper default (/usr/bin/tail -f /dev/null).
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
containerShell¶
Jenkins-specific: Used for proper environment setup.
Allows to specify the shell to be executed for container with containerName.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerEnvVars¶
Environment variables to set in the container, e.g. [http_proxy: "proxy:8080"].
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerImage¶
Name of the docker image that should be used. If empty, Docker is not used and the command is executed directly on the Jenkins system.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | ppiper/cm-client:3.0.0.0 |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerName¶
Kubernetes only: Name of the container launching dockerImage. SideCar only: Name of the container in local network.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | cmclient |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerOptions¶
Docker options to be set when starting the container.
Scope | Details |
---|---|
Aliases | - |
Type | []string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerPullImage¶
Set this to 'false' to bypass a docker image pull. Useful during development process. Allows testing of images which are available in the local registry only.
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | true |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerVolumeBind¶
Jenkins-specific: Used for proper environment setup.
Volumes that should be mounted into the docker container.
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerWorkspace¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Specifies a dedicated user home directory for the container which will be passed as value for environment variable HOME
.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
endpoint¶
The service endpoint
Scope | Details |
---|---|
Aliases | changeManagement/endpoint |
Type | string |
Mandatory | yes |
Default | $PIPER_endpoint (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
failIfStatusIsNotInDevelopment¶
lets the build fail in case the change is not in status 'in developent'. Otherwise a warning is emitted to the log
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | true |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
password¶
Service user password to authenticate against the ABAP backend
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | $PIPER_password (if set) |
Secret | yes |
Configuration scope |
|
Resource references | Jenkins credential id: id: credentialsId reference to: password |
script¶
The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the this
parameter, as in script: this
. This allows the function to access the commonPipelineEnvironment
for retrieving, e.g. configuration parameters.
Scope | Details |
---|---|
Aliases | - |
Type | Jenkins Script |
Mandatory | yes |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
username¶
Service user to authenticate against the ABAP backend
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | $PIPER_username (if set) |
Secret | yes |
Configuration scope |
|
Resource references | Jenkins credential id: id: credentialsId reference to: username |
verbose¶
verbose output
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
credentialsId¶
Jenkins 'Username with password' credentials ID containing user and password to authenticate against the ABAP backend
Scope | Details |
---|---|
Aliases | changeManagement/credentialsId |
Type | string |
Configuration scope |
|
Examples¶
# config.yaml
general:
changeManagement:
credentialsId: 'SOLMAN_CRED_ID'
endpoint: 'https://example.org/cm/solman/endpoint'
steps:
isChangeInDevelopment:
dockerImage: 'ppiper/cm-client:3.0.0.0'
transportRequestUploadSOLMAN:
dockerImage: 'ppiper/cm-client:3.0.0.0'
applicationId: 'APPID',
filePath: '/path/file.ext',
// pipeline script
...
stage('Upload') {
transportRequestDocIDFromGit( script: this )
isChangeInDevelopment( script: this )
transportRequestReqIDFromGit( script: this )
transportRequestUploadSOLMAN( script: this )
}