github.com/xgoffin/jenkins-library@v1.154.0/documentation/docs/steps/transportRequestUploadCTS.md (about)

     1  # ${docGenStepName}
     2  
     3  ## ${docGenDescription}
     4  
     5  ## Prerequisites
     6  
     7  * You have installed the [SAP component SAP_UI 7.53](https://help.sap.com/viewer/6f3c61a7a5b94447b80e72f722b0aad7/202009.002/en-US/35828457ed26452db8d51c840813f1bb.html) or higher on your ABAP system.
     8  * You have enabled the OData Service to load data to the [SAPUI5 ABAP repository](https://sapui5.hana.ondemand.com/#/topic/a883327a82ef4cc792f3c1e7b7a48de8.html).
     9  * You have the [S_DEVELOP authorization](https://sapui5.hana.ondemand.com/#/topic/a883327a82ef4cc792f3c1e7b7a48de8.html) to perform operations in your SAPUI5 ABAP repository.
    10  * You have created a transport request on the ABAP system, which is the target container of the SAPUI5 application for your upload.
    11  
    12  ## Setting Up an Upload Client
    13  
    14  The step `transportRequestUploadCTS` uses the [Node.js](https://nodejs.org)-based [SAP Fiori tools](https://help.sap.com/viewer/product/SAP_FIORI_tools/Latest/en-US) to upload your SAPUI5 application to the UI5 repository service of your ABAP back-end infrastructure. It performs the deployment command [Fiori deploy](https://www.npmjs.com/package/@sap/ux-ui5-tooling#fiori-deploy---performs-the-deployment-of-the-application-into-an-abap-system) on a Docker image.
    15  
    16  By default, a plain [node.js Docker image](https://hub.docker.com/_/node) is pulled and equipped with the SAPUI5 toolset during runtime of the pipeline.
    17  Alternatively, you can provide your own, fully equipped Docker image. This speeds up the upload process, but requires you to maintain and provision the image on a Docker registry.
    18  
    19  ### Creating a Fully Equipped Docker Image
    20  
    21  To create an own Docker image with the [SAP Fiori tools](https://help.sap.com/viewer/product/SAP_FIORI_tools/Latest/en-US), proceed as follows:
    22  
    23  1. Create a node.js based Docker image with the SAP Fiori tools installed:
    24  
    25      ```Dockerfile
    26      FROM node
    27      USER root
    28      RUN npm install -global @ui5/cli @sap/ux-ui5-tooling @ui5/logger @ui5/fs
    29      USER node
    30      ```
    31  
    32      ```/bin/bash
    33      docker build -t my/fiori-node .
    34      ```
    35  
    36  1. Push your image to your private [Docker Hub registry](https://hub.docker.com/):
    37  
    38      ```/bin/bash
    39      docker push my/fiori-node  
    40      ```
    41  
    42  1. Add the following content to your `config.yml` file:
    43  
    44      ```yaml
    45      steps:
    46        transportRequestUploadCTS:
    47          dockerImage: 'my/fiori-node'
    48          deployToolDependencies: []
    49      ```
    50  
    51  ## Building an SAPUI5 Application
    52  
    53  Build your SAPUI5 application with the build command of the SAPUI5 toolset and use the step [npmExecuteScripts](npmExecuteScripts.md) to run the build command. Proceed as follows to do so:
    54  
    55  1. Configure the steps in the `package.json` file of your project as follows:
    56  
    57      ```json
    58      {
    59         ...
    60         "scripts": {
    61            "start": "ui5 serve",
    62            "test": "npm run lint",
    63            "build": "ui5 build --clean-dest",
    64            ...
    65         },
    66         "dependencies": {},
    67         "devDependencies": {
    68            "@ui5/cli": "^2.11.2",
    69            ...
    70         }
    71      }
    72      ```
    73  
    74  1. Configure the execution step in the pipeline as follows:
    75  
    76      ```groovy
    77      stage('Build') {
    78         npmExecuteScripts(script: this, runScripts: ['build'])
    79      }
    80      ```
    81  
    82  **Note:** Do not use the `mtaBuild` step. The MTA Build Tool `mta` is dedicated to the SAP Business Technology Platform. It does neither create the expected `dist` folder nor the compliant content.
    83  
    84  ## Uploading an SAPUI5 Application
    85  
    86  The Fiori toolset uses the [ODATA service](https://ui5.sap.com/#/topic/a883327a82ef4cc792f3c1e7b7a48de8) to upload your UI5 application to the SAPUI5 ABAP repository. It controls access by [Basic Authentication](https://help.sap.com/viewer/e815bb97839a4d83be6c4fca48ee5777/202009.002/en-US/43960f4a527b58c1e10000000a422035.html?q=basic%20authentication) (user/password based authentication).
    87  
    88  **Note:** Do not upload your application to SAP Business Technology Platform. The SAP BTP does not support `Basic Authentication`.
    89  
    90  **Note:** Use an HTTPS endpoint to ensure the encryption of your credentials.
    91  
    92  ## Specifying the Transport Request
    93  
    94  The target of the upload is a transport request, identified by an identifier (ID).
    95  
    96  The step `transportRequestUploadCTS` allows you to set the ID by parameter.
    97  
    98  Alternatively, you can pass the ID through the parameter `commonPipelineEnvironment`.
    99  For example, by performing a step that generates the ID or obtains it differently.
   100  For more information, see [transportRequestReqIDFromGit](transportRequestReqIDFromGit.md).
   101  
   102  ### Adding a Parameter
   103  
   104  A parameterized pipeline allows you to specify the ID with the launch of each build instead of entering it statically into the pipeline.
   105  
   106  ```groovy
   107  transportRequestUploadCTS(
   108      script: this,
   109      transportRequestId: ${TRANSPORT_REQUEST_ID},
   110      ...
   111  )
   112  ```
   113  
   114  The Jenkins pipeline `input` step allows you to specify the ID at runtime of the pipeline.
   115  
   116  ```groovy
   117  def ids = input( message: "Upload?",
   118      parameters: [
   119          string(name: 'TRANSPORT_REQUEST_ID',description: 'Transport Request ID')
   120      ]
   121  )
   122  
   123  transportRequestUploadCTS(
   124      script:this,
   125      transportRequestId: ids['TRANSPORT_REQUEST_ID'],
   126      ...
   127  )
   128  ```
   129  
   130  ## Common Pipeline Environment
   131  
   132  Use the step [transportRequestReqIDFromGit](transportRequestReqIDFromGit.md) to obtain the  `transportRequestId` value from your Git commit messages.
   133  
   134  This step extracts the ID from the commit messages of your project repository and enters it into the `commonPipelineEnvironment`. In turn, the upload step `transportRequestUploadCTS` picks it up from there.
   135  
   136  ```groovy
   137  transportRequestReqIDFromGit( script: this )
   138  transportRequestUploadCTS( script: this, ... )
   139  ```
   140  
   141  ## ${docGenParameters}
   142  
   143  ## ${docGenConfiguration}
   144  
   145  ## ${docJenkinsPluginDependencies}
   146  
   147  ## Example
   148  
   149  ```yaml
   150  # config.yaml
   151  steps:
   152    transportRequestUploadCTS:
   153      changeManagement:
   154        credentialsId: 'CTS_CREDENTIALS_ID'
   155        endpoint: 'https://example.org'
   156        client: '001'
   157      abapPackage: 'PACK'
   158      applicationName: 'APP'
   159  ```
   160  
   161  ```groovy
   162  // pipeline script
   163     stage('Init') {
   164        transportRequestReqIDFromGit( script: this )
   165     }
   166     stage('Build') {
   167        npmExecuteScripts( script: this, runScripts: ['build'])
   168     }
   169     stage('Upload') {
   170        transportRequestUploadCTS( script: this)
   171     }
   172  ```