github.com/ouraigua/jenkins-library@v0.0.0-20231028010029-fbeaf2f3aa9b/documentation/docs/steps/neoDeploy.md (about)

     1  # ${docGenStepName}
     2  
     3  ## ${docGenDescription}
     4  
     5  ## Prerequisites
     6  
     7  * **SAP BTP account** - the account to where the application is deployed. To deploy MTA (`deployMode: mta`) an over existing _Java_ application, free _Java Quota_ of at least 1 is required, which means that this will not work on trial accounts.
     8  * **SAP BTP user for deployment** - a user with deployment permissions in the given account.
     9  * **Jenkins credentials for deployment** - must be configured in Jenkins credentials with a dedicated Id.
    10  
    11  ![Jenkins credentials configuration](../images/neo_credentials.png)
    12  
    13  * **Neo Java Web SDK 3.39.10 or compatible version** - can be downloaded from [Maven Central](http://central.maven.org/maven2/com/sap/cloud/neo-java-web-sdk/). This step is capable of triggering the neo deploy tool provided inside a docker image. We provide docker image `ppiper/neo-cli`. `neo.sh` needs to be contained in path, e.g by adding a symbolic link to `/usr/local/bin`.
    14  
    15  * **Java 8 or compatible version** - needed by the _Neo-Java-Web-SDK_. Java environment needs to be properly configured (JAVA_HOME, java exectutable contained in path).
    16  
    17  ## ${docGenParameters}
    18  
    19  ## ${docGenConfiguration}
    20  
    21  ## ${docJenkinsPluginDependencies}
    22  
    23  ## Side effects
    24  
    25  none
    26  
    27  ## Exceptions
    28  
    29  * `Exception`:
    30    * If `source` is not provided.
    31    * If `propertiesFile` is not provided (when using `'WAR_PROPERTIESFILE'` deployment mode).
    32    * If `application` is not provided (when using `'WAR_PARAMS'` deployment mode).
    33    * If `runtime` is not provided (when using `'WAR_PARAMS'` deployment mode).
    34    * If `runtimeVersion` is not provided (when using `'WAR_PARAMS'` deployment mode).
    35  * `AbortException`:
    36    * If neo-java-web-sdk is not properly installed.
    37  * `CredentialNotFoundException`:
    38    * If the credentials cannot be resolved.
    39  
    40  ## Example
    41  
    42  ```groovy
    43  neoDeploy script: this, source: 'path/to/archiveFile.mtar', neo: [credentialsId: 'my-credentials-id', host: hana.example.org]
    44  ```
    45  
    46  Example configuration:
    47  
    48  ```yaml
    49  steps:
    50    <...>
    51    neoDeploy:
    52      deployMode: mta
    53      neo:
    54        account: <myDeployAccount>
    55        host: hana.example.org
    56  ```
    57  
    58  ## Example for invalidating the cache
    59  
    60  Set the parameter `invalidateCache` to `true` to clean up the cache of an SAP Fiori launchpad site by refreshing the content of HTML5 applications deployed in it.
    61  
    62  **Note:** This section is only applicable for HTML5 applications accessed through an SAP Fiori launchpad site.
    63  
    64  Setting this parameter to `true` requires additional configuration:
    65  
    66  ### Create an OAuth credential
    67  
    68  1. In your subaccount, choose **OAuth**.
    69  
    70      ![OAuth client creation](../images/oauthClientCreation.png)
    71  
    72  2. In the **Subscription** field, select the portal landscape to which you would like to subscribe, for example, `portal/nwc` or `portal/sandbox`.
    73  
    74      ![Portal subscription](../images/portalSubscription.png)
    75  
    76  3. From the drop-down menu in the **Authorization Grant** field, choose **Client Credentials**.
    77  
    78  4. In the **Secret** field, enter a user-defined password and save your changes.
    79  
    80  5. In Jenkins, create new username/password credentials. As username, use the client ID and as password, use the client secret.
    81  
    82  ### Configure the site ID
    83  
    84  When you're logged in to the portal service, you can retrieve the site ID. Either configure it in your configuration file or set the site as default through the **Site Directory** tile.
    85  If you don't set it as default, configure the parameter `siteId` as follows in your configuration file:
    86  
    87  ```yaml
    88  steps:
    89    <...>
    90    neoDeploy:
    91      neo:
    92        account: <myDeployAccount>
    93        host: hana.example.org
    94        credentialsId: 'my-credentials-id'
    95        invalidateCache: true
    96        portalLandscape: "cloudnwcportal"
    97        oauthCredentialId: <OAUTH_CREDENTIAL_ID>
    98        siteId: <PORTAL_SITE_ID> # not required, if the default site is already set in the portal service (SAP BTP)
    99  ```