1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/documentation/docs/scenarios/ui5-sap-cp
2020-04-27 13:14:57 +02:00
..
files adapt UI5 scenario docu (#1336) 2020-04-27 13:14:57 +02:00
images New Scenario Step: SAP UI5 on SAP Cloud Platform (#388) 2019-01-15 13:32:01 +01:00
Readme.md adapt UI5 scenario docu (#1336) 2020-04-27 13:14:57 +02:00

Build and Deploy SAPUI5 or SAP Fiori Applications on SAP Cloud Platform with Jenkins

Build an application based on SAPUI5 or SAP Fiori with Jenkins and deploy the build result into an SAP Cloud Platform account in the Neo environment.

Prerequisites

  • You have installed the Java Runtime Environment 8.
  • You have installed Jenkins 2.60.3 or higher.
  • You have set up Project “Piper”. See README.
  • You have installed the Multi-Target Application (MTA) Archive Builder 1.0.6 or newer. See SAP Development Tools.
  • You have installed Node.js including node and npm. See Node.js.
  • You have installed the SAP Cloud Platform Neo Environment SDK. See SAP Development Tools.

Project Prerequisites

This scenario requires additional files in your project and in the execution environment on your Jenkins instance.

On the project level, provide and adjust the following template:

File Name Description Position
.npmrc This file contains a reference to the SAP NPM registry (@sap:registry https://npm.sap.com), which is required to fetch the dependencies required to build the application. Place the .npmrc file in the root directory of your project.
mta.yaml This file controls the behavior of the MTA toolset. Place the mta.yaml file in your application root folder and adjust the values in brackets with your data.
package.json This file lists the required development dependencies for the build. Add the content of the package.json file to your existing package.json file.
Gruntfile.js This file controls the grunt build. By default the tasks clean, build, and lint are executed. Place the Gruntfile.js in the root directory of your project.

Context

This scenario combines various different steps to create a complete pipeline.

In this scenario, we want to show how to build an application based on SAPUI5 or SAP Fiori by using the multi-target application (MTA) concept and how to deploy the build result into an SAP Cloud Platform account in the Neo environment. This document comprises the mtaBuild and the neoDeploy steps.

This pipeline in Jenkins Blue Ocean

Screenshot: Build and Deploy Process in Jenkins

Example

Jenkinsfile

Following the convention for pipeline definitions, use a Jenkinsfile which resides in the root directory of your development sources.

@Library('piper-lib-os') _

fioriOnCloudPlatformPipeline script:this

fioriOnCloudPlatform is a so called scenario step that wraps the mtaBuild and the neoDeploy steps.

Configuration (.pipeline/config.yml)

This is a basic configuration example, which is also located in the sources of the project. The configuration corresponds to the steps wrapped in fioriOnCloudPlatformPipeline.

steps:
  mtaBuild:
    buildTarget: 'NEO'
    platform: 'neo'
  neoDeploy:
    neo:
      credentialsId: 'NEO_DEPLOY'
      account: 'your-account-id'
      host: 'hana.ondemand.com'

Configuration for the MTA Build

Parameter Description
buildTarget The target platform to which the mtar can be deployed. Possible values are: CF, NEO, XSA
mtaJarLocation The location of the multi-target application archive builder jar file, including file name and extension.

Configuration for the Deployment to SAP Cloud Platform

Parameter Description
account The SAP Cloud Platform account to deploy to.
credentialsId The Jenkins credentials that contain the user and password which are used for the deployment on SAP Cloud Platform.
host The SAP Cloud Platform host to deploy to.

Parameters

For the detailed description of the relevant parameters, see: