github.com/jaylevin/jenkins-library@v1.230.4/documentation/docs/scenarios/TMS_Extension.md (about)

     1  # Integrate SAP Cloud Transport Management Into Your CI/CD Pipeline
     2  
     3  Extend your CI/CD pipeline with SAP Cloud Transport Management service to add an enterprise-ready change and release management process and enable the transport of cloud-based applications on SAP Business Technology Platform (BTP) between several stages.
     4  
     5  ## Context
     6  
     7  This procedure explains how to upload a [multitarget application (MTA)](https://www.sap.com/documents/2016/06/e2f618e4-757c-0010-82c7-eda71af511fa.html) from a CI/CD pipeline to Cloud Transport Management and then import it into its target environment.
     8  
     9  Cloud Transport Management allows you to manage the transport of development artifacts and application-specific content between different SAP BTP accounts. It adds transparency to the audit trail of changes so that you get information about who performed which changes in your production accounts and when they did it. At the same time, Cloud Transport Management enables a separation of concerns: For example, a developer of an application or of SAP Cloud content artifacts can trigger the propagation of changes, while the resulting transport is handled by a central operations team. For more information, see [SAP Cloud Transport Management](https://help.sap.com/viewer/product/TRANSPORT_MANAGEMENT_SERVICE/Cloud/en-US).
    10  
    11  The following graphic provides an overview about the interplay between continuous integration and Cloud Transport Management:
    12  
    13  ![Interplay of CI and Cloud Transport Management](../images/Interplay_TMS.png "Interplay of CI and Transport Management")
    14  
    15  ## Prerequisites
    16  
    17  * You have an existing CI pipeline, which you want to extend with Cloud Transport Management.
    18  * You have an multitarget application (MTA) project, and the folder structure of its sources corresponds to the standard MTA structure. For more information about MTAs, see:
    19    * [Multitarget Applications in the Cloud Foundry Environment](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/d04fc0e2ad894545aebfd7126384307c.html)
    20    * [Multitarget Applications for the Neo Environment](https://help.sap.com/viewer/ea72206b834e4ace9cd834feed6c0e09/Cloud/en-US/e1bb7eb746d34237b8b47035adff5022.html)
    21  * You have access to Cloud Transport Management. See [Provide Access to SAP Cloud Transport Management](https://help.sap.com/viewer/7f7160ec0d8546c6b3eab72fb5ad6fd8/Cloud/en-US/13894bed9e2d4b25aa34d03d002707f9.html).
    22  * You have set up Cloud Transport Management and created a service key. See [Set Up the Environment to Transport Content Archives directly in an Application](https://help.sap.com/viewer/7f7160ec0d8546c6b3eab72fb5ad6fd8/Cloud/en-US/8d9490792ed14f1bbf8a6ac08a6bca64.html).
    23  * You have configured your transport landscape. See [Configuring the Landscape](https://help.sap.com/viewer/7f7160ec0d8546c6b3eab72fb5ad6fd8/Cloud/en-US/3e7b04236d804a4eb80e42c6360209f1.html).
    24  
    25  ## Procedure
    26  
    27  You can use this scenario to extend any CI process that meets the prerequisites, for example, the one described in [Build and Deploy SAPUI5 or SAP Fiori Applications on SAP BTP with Jenkins](https://sap.github.io/jenkins-library/scenarios/ui5-sap-cp/Readme/).
    28  
    29  The following graphic shows an example of the detailed procedure when combining continuous integration and Cloud Transport Management:
    30  
    31  ![Detailed Procedure When Combining CI and Cloud Transport Management](../images/Detailed_Process_TMS.png "Detailed Procedure When Combining CI and SAP Cloud Transport Management")
    32  
    33  The process flow contains the following steps:
    34  
    35  1. The CI server builds a MTA archive.
    36  1. The MTA is uploaded into the import queue of the target node, which is specified in the CI pipeline (in this example, PRE-PROD).
    37  1. Optionally, for transports in Cloud Foundry environment, MTA extension descriptors can be uploaded to the nodes in the transport landscape to provide node-specific import configurations. The MTA extension descriptor file must either be part of the repository, or be the result of the build process.
    38  1. The release manager manually triggers the import, or schedules it, which results in the physical deployment of the MTA archive into the corresponding subaccount (in this example, PRE-PROD). If an MTA extension descriptor was uploaded for this node, it will be used for the import.
    39  1. As soon as the import is executed, a transport is triggered along the defined transport route so that the MTA archive reaches the import queue of the next node (in this example, PROD).
    40  1. There, the physical import into the corresponding subaccount can be either triggered manually by the release manager or automatically by using the scheduling mechanisms of Cloud Transport Management.
    41  
    42  ## Example
    43  
    44  ### Jenkinsfile
    45  
    46  If you use the pipeline of the following code snippet, you only have to configure it in the .pipeline/config.yml.
    47  
    48  Following the convention for pipeline definitions, use a Jenkinsfile, which resides in the root directory of your development sources.
    49  
    50  ```groovy
    51  @Library('piper-lib-os') _
    52  
    53  piperPipeline script:this
    54  ```
    55  
    56  ### Configuration (`.pipeline/config.yml`)
    57  
    58  This is a basic configuration example, which is also located in the sources of the project.
    59  
    60  ```yaml
    61  steps:
    62    tmsUpload:
    63      credentialsId: tms-secret-key
    64      nodeName: PRE-PROD
    65      mtaPath: com.piper.example.tms.mtar
    66      customDescription: Custom-Transport-Description
    67  
    68  # uploading MTA extension descriptors, optional step
    69      mtaVersion: 1.0.0
    70      nodeExtDescriptorMapping:
    71        PRE-PROD: 'scv_x_preprod.mtaext'
    72        PROD: 'scv_x_prod.mtaext'
    73  
    74  stages:
    75    Release:
    76      tmsUpload: true
    77  
    78  ```
    79  
    80  #### Configuration for the Upload to Cloud Transport Management
    81  
    82  | Parameter          | Description |
    83  | -------------------|-------------|
    84  | `credentialsId` |Credentials that are used for the file and node uploads to Cloud Transport Management.|
    85  | `nodeName`|Defines the name of the node to which the *.mtar file is uploaded.|
    86  | `mtaPath`|Defines the path to the *.mtar file for the upload to Cloud Transport Management.|
    87  | `customDescription`|Optional: Description of a transport request. Overwrites the default (Default: Corresponding Git Commit-ID).|
    88  |`nodeExtDescriptorMapping`|Optional: Defines the mapping between a transport node and the MTA extension descriptor file that is used for the transport node. You specify the node name and the relative path to the MTA extension descriptor file using the syntax which is shown in the configuration example.|
    89  |`mtaVersion`|Optional: Defines the version of the MTA for which the MTA extension descriptor is used. You can use an asterisk (*) to accept any MTA version, or use a specific version compliant with SemVer 2.0, e.g. 1.0.0 (see semver.org). If the parameter is not configured, an asterisk is used.|
    90  
    91  ### Parameters
    92  
    93  For a detailed description of the relevant parameters, see [tmsUpload](../../steps/tmsUpload/).