1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-03-03 15:02:35 +02:00

transportRequestUploadFile: generate docu

This commit is contained in:
Alejandra Ferreiro Vidal 2019-03-28 10:10:01 +01:00
parent 1195501d22
commit 4c62102fa8
2 changed files with 72 additions and 37 deletions

View File

@ -1,46 +1,14 @@
# transportRequestUploadFile
# ${docGenStepName}
## Description
Uploads a file to a Transport Request.
## ${docGenDescription}
## Prerequisites
* **[Change Management Client 2.0.0 or compatible version](http://central.maven.org/maven2/com/sap/devops/cmclient/dist.cli/)** - available for download on Maven Central.
## Parameters
## ${docGenParameters}
| parameter | mandatory | default | possible values |
| -----------------|-----------|--------------------------------------------------------|--------------------|
| `script` | yes | | |
| `changeDocumentId` | `SOLMAN` only | | |
| `transportRequestId`| yes | | |
| `applicationId` | `SOLMAN` only | | |
| `filePath` | yes | | |
| `changeManagement/credentialsId` | yes | | |
| `changeManagement/endpoint` | yes | | |
| `changeManagement/git/from` | no | `origin/master` | |
| `changeManagement/git/to` | no | `HEAD` | |
| `changeManagement/changeDocumentLabel` | no | `ChangeDocument\s?:` | regex pattern |
| `changeManagement/transportRequestLabel` | no | `TransportRequest\s?:` | regex pattern |
| `changeManagement/git/format` | no | `%b` | see `git log --help` |
| `changeManagement/type` | no | `SOLMAN` | `SOLMAN`, `CTS` |
* `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`](commonPipelineEnvironment.md) for retrieving, for example, configuration parameters.
* `changeDocumentId` - For type `SOLMAN` only. The id of the change document related to the transport request to release. Typically provided via commit history.
* `transportRequestId` - The id of the transport request to release. Typically provided via commit history.
* `applicationId` - For type `SOLMAN` only. The id of the application.
* `filePath` - The path of the file to upload.
* `changeManagement/credentialsId` - The credentials to connect to the service endpoint (Solution Manager, ABAP System).
* `changeManagement/endpoint` - The service endpoint (Solution Manager, ABAP System).
* `changeManagement/git/from` - The starting point for retrieving the change document id and/or transport request id
* `changeManagement/git/to` - The end point for retrieving the change document id and/or transport request id
* `changeManagement/changeDocumentLabel` - For type `SOLMAN` only. A pattern used for identifying lines holding the change document id.
* `changeManagement/transportRequestLabel` - A pattern used for identifying lines holding the transport request id.
* `changeManagement/type` Where/how the transport request is created (via SAP Solution Manager, ABAP).
* `changeManagement/git/format` - Specifies what part of the commit is scanned. By default the body of the commit message is scanned.
## Step configuration
## ${docGenConfiguration}
The step is configured using a customer configuration file provided as
resource in an custom shared library.

View File

@ -3,6 +3,7 @@ import static com.sap.piper.Prerequisites.checkScript
import com.sap.piper.Utils
import groovy.transform.Field
import com.sap.piper.GenerateDocumentation
import com.sap.piper.ConfigurationHelper
import com.sap.piper.cm.ChangeManagement
import com.sap.piper.cm.BackendType
@ -17,25 +18,91 @@ import static com.sap.piper.cm.StepHelpers.getBackendTypeAndLogInfoIfCMIntegrati
@Field def STEP_NAME = getClass().getName()
@Field Set GENERAL_CONFIG_KEYS = [
'changeManagement'
'changeManagement',
/**
* @see checkChangeInDevelopment
* @parentConfigKey changeManagement
*/
'changeDocumentLabel',
/**
* Defines where the transport request is created, e.g. SAP Solution Manager, ABAP System.
* @parentConfigKey changeManagement
* @possibleValues `SOLMAN`, `CTS`, `RFC`
*/
'type',
/**
* @see checkChangeInDevelopment
* @parentConfigKey changeManagement
*/
'clientOpts',
/**
* @see checkChangeInDevelopment
* @parentConfigKey changeManagement
*/
'credentialsId',
/**
* @see checkChangeInDevelopment
* @parentConfigKey changeManagement
*/
'endpoint',
/**
* @see checkChangeInDevelopment
* @parentConfigKey changeManagement
*/
'git/from',
/**
* @see checkChangeInDevelopment
* @parentConfigKey changeManagement
*/
'git/to',
/**
* @see checkChangeInDevelopment
* @parentConfigKey changeManagement
*/
'git/format',
/**
* @see transportRequestCreate
* @parentConfigKey changeManagement
*/
'rfc/developmentInstance',
/**
* @see transportRequestCreate
* @parentConfigKey changeManagement
*/
'rfc/developmentClient',
/**
* A pattern used for identifying lines holding the transport request id.
* @parentConfigKey changeManagement
*/
'changeManagement/transportRequestLabel'
]
@Field Set STEP_CONFIG_KEYS = GENERAL_CONFIG_KEYS.plus([
'applicationName', // RFC
/** The id of the application. Only for `SOLMAN`.*/
'applicationId', // SOLMAN
'applicationDescription',
/** The path of the file to upload.*/
'filePath', // SOLMAN, CTS
/** The URL where to find the UI5 package to upload to the transport request. Only for `RFC`. */
'applicationUrl', // RFC
/** The ABAP package name of your application. */
'abapPackage',
/** The code page of your ABAP system. E.g. UTF-8. */
'codePage', //RFC
'acceptUnixStyleLineEndings', // RFC
/** @see transportRequestCreate */
'verbose', // RFC
])
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS.plus([
/** @see transportRequestCreate */
'changeDocumentId',
/** The id of the transport request to upload the file.*/
'transportRequestId'])
/** Uploads a file to a Transport Request. */
@GenerateDocumentation
void call(parameters = [:]) {
handlePipelineStepErrors (stepName: STEP_NAME, stepParameters: parameters) {