Skip to content

transportRequestUploadSOLMAN

Uploads a specified file into a given transport via Solution Manager

Description

Uploads the specified file into the given transport request via Solution Manager. The mandatory change document ID points to the associate change document item. The application ID specifies how the file needs to be handled on server side.

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')

transportRequestUploadSOLMAN script: this
piper transportRequestUploadSOLMAN

Outputs

Output type Details
commonPipelineEnvironment
  • custom/changeDocumentId
  • custom/transportRequestId

Prerequisites

  • You have an SAP Solution Manager user account and the roles required for uploading. See SAP Solution Manager Administration.
  • You have a change document to which your transport request is coupled.
  • You have a transport request, which is the target container of the upload.
  • You have installed the Change Management Client with the needed certificates. See Change Management Client.

Change Management Client

The Change Management Client (CM Client) handles the access to SAP Solution Manager. The CM Client is a software running under Linux, which can initiate basic change management tasks in the Solution Manager. The client is used by default as a Docker image, but can also be installed as a command line tool.

Certificates

It is expected that the Solution Manager endpoint is secured by SSL and sends a certificate accordingly. The CM Client verifies the certificate. If the publisher of this certificate is unknown, the connection will be rejected. The CM Client uses the underlying JDK procedures for the verification. Accordingly, the issuer must be specified in the truststore of the JDK.

Create a clone of the image and add the necessary certificate to its truststore in case you use the Docker image. Extend the truststore of the environment with the necessary certificate in the case you use the immediate command line tool.

Specifying the Change Document and Transport Request

The target of the upload is a transport request and the associated change document. Both objects are identified by identifiers (ID). transportRequestUploadSOLMAN allows you to set IDs by parameter. Alternatively, you can pass the IDs through the Common Pipeline Environment. For example, by performing a step that generates the IDs or obtains them differently. See transportRequestDocIDFromGit and transportRequestReqIDFromGit

By Step Parameter

A parameterized pipeline allows to specify the IDs with the launch of the build instead of entering them statically into the pipeline.

transportRequestUploadSOLMAN(
    script: this,
    changeDocumentId: ${CHANGE_DOCUMENT_ID},
    transportRequestId: ${TRANSPORT_REQUEST_ID},
    ...
)

The Jenkins pipeline input step allows to specify the IDs at runtime of the pipeline.

def ids = input( message: "Upload?",
    parameters: [
        string(name: 'CHANGE_DOCUMENT_ID',description: 'Change Document ID'),
        string(name: 'TRANSPORT_REQUEST_ID',description: 'Transport Request ID')
    ]
)

transportRequestUploadSOLMAN(
    script:this,
    changeDocumentId: ids['CHANGE_DOCUMENT_ID'],
    transportRequestId: ids['TRANSPORT_REQUEST_ID'],
    ...
)

Common Pipeline Environment

With OS Piper you can use the steps transportRequestDocIDFromGit and transportRequestReqIDFromGit to obtain the changeDocumentId and transportRequestId values from your Git commit messages. The steps enter the IDs into the commonPipelineEnvironment, in turn, the upload step transportRequestUploadSOLMAN picks them up from there.

transportRequestDocIDFromGit( script: this )
transportRequestReqIDFromGit( script: this )
transportRequestUploadSOLMAN( script: this, ... )

Parameters

Overview - Step

Name Mandatory Additional information
applicationId yes
changeDocumentId yes
cmClientOpts yes
endpoint yes
filePath yes
password (yes) Secret pass via ENV or Jenkins credentials (uploadCredentialsId)
script (yes) Jenkins only reference to Jenkins main pipeline script
transportRequestId yes
username (yes) Secret pass via ENV or Jenkins credentials (uploadCredentialsId)
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 Jenkins only
containerShell no Jenkins only
dockerEnvVars no
dockerImage no
dockerName no
dockerOptions no
dockerPullImage no
dockerVolumeBind no Jenkins only
dockerWorkspace no Jenkins only

Details

applicationId

Id of the application. Specifies how the file needs to be handled on server side

back to overview

Scope Details
Aliases -
Type string
Mandatory yes
Default $PIPER_applicationId (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

changeDocumentId

ID of the change document to which the file is uploaded

back to overview

Scope Details
Aliases -
Type string
Mandatory yes
Default $PIPER_changeDocumentId (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☐ steps
  • ☐ stages
Resource references commonPipelineEnvironment:
  reference to: custom/changeDocumentId

cmClientOpts

Additional options handed over to the cm client

back to overview

Scope Details
Aliases - clientOpts
- changeManagement/clientOpts
Type []string
Mandatory yes
Default $PIPER_cmClientOpts (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
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).

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

containerShell

Jenkins-specific: Used for proper environment setup.

Allows to specify the shell to be executed for container with containerName.

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerEnvVars

Jenkins-specific: Used for proper environment setup.

Environment variables to set in the container, e.g. [http_proxy: "proxy:8080"].

back to overview

Scope Details
Aliases -
Type map[string]string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerImage

Jenkins-specific: Used for proper environment setup.

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.

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default ppiper/cm-client:3.0.0.0
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerName

Jenkins-specific: Used for proper environment setup.

Kubernetes only: Name of the container launching dockerImage. SideCar only: Name of the container in local network.

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default cmclient
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerOptions

Jenkins-specific: Used for proper environment setup.

Docker options to be set when starting the container.

back to overview

Scope Details
Aliases -
Type []string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerPullImage

Jenkins-specific: Used for proper environment setup.

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.

back to overview

Scope Details
Aliases -
Type bool
Mandatory no
Default true
Possible values - true
- false
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerVolumeBind

Jenkins-specific: Used for proper environment setup.

Volumes that should be mounted into the docker container.

back to overview

Scope Details
Aliases -
Type map[string]string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
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.

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

endpoint

Service endpoint

back to overview

Scope Details
Aliases changeManagement/endpoint
Type string
Mandatory yes
Default $PIPER_endpoint (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

filePath

Name/Path of the file which should be uploaded

back to overview

Scope Details
Aliases -
Type string
Mandatory yes
Default $PIPER_filePath (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references commonPipelineEnvironment:
  reference to: mtarFilePath

password

Service user password for uploading to the Solution Manager

back to overview

Scope Details
Aliases -
Type string
Mandatory yes
Default $PIPER_password (if set)
Secret yes
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☐ steps
  • ☐ stages
Resource references Jenkins credential id:
  id: uploadCredentialsId
  reference to: password

script

Jenkins-specific: Used for proper environment setup.

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.

back to overview

Scope Details
Aliases -
Type Jenkins Script
Mandatory yes
Default
Secret no
Configuration scope
  • ☐ parameter
  • ☐ general
  • ☐ steps
  • ☐ stages
Resource references none

transportRequestId

ID of the transport request to which the file is uploaded

back to overview

Scope Details
Aliases -
Type string
Mandatory yes
Default $PIPER_transportRequestId (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☐ steps
  • ☐ stages
Resource references commonPipelineEnvironment:
  reference to: custom/transportRequestId

username

Service user for uploading to the Solution Manager

back to overview

Scope Details
Aliases -
Type string
Mandatory yes
Default $PIPER_username (if set)
Secret yes
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references Jenkins credential id:
  id: uploadCredentialsId
  reference to: username

verbose

verbose output

back to overview

Scope Details
Aliases -
Type bool
Mandatory no
Default false
Possible values - true
- false
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

uploadCredentialsId

Jenkins-specific: Used for proper environment setup. See using credentials for details.

Jenkins 'Username with password' credentials ID containing user and password to authenticate against the ABAP backend

back to overview

Scope Details
Aliases changeManagement/credentialsId
Type string
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages

Example

transportRequestUploadSOLMAN(
  script: this,
  endpoint: 'https://example.org/cm/solman/endpoint'
  applicationId: 'ABC',
  uploadCredentialsId: "SOLMAN_CRED_ID"
  changeDocumentId: '1000001234',
  transportRequestId: 'ABCD10005E',
  filePath: '/path/file.ext',
  cmClientOpts: '-Dkey=value'
)