1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-07-15 01:34:38 +02:00

ABAP deploy to front end server via existing fiori upload facilities (#1939)

The approach used up to now did not (... never) work since the uploaded content was always assigned to the `$TMP` package. In the meanwhile there is some fiori tooling available for managing such uploads.

Now we re-use this fiori tooling.

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
This commit is contained in:
Marcus Holl
2020-10-21 12:04:11 +02:00
committed by GitHub
parent dc3bf0e68d
commit 4f9bc698f9
6 changed files with 520 additions and 74 deletions

View File

@ -64,6 +64,80 @@ The properties can also be configured on a per-step basis:
The parameters can also be provided when the step is invoked. For examples see below.
## CTS Uploads
In order to be able to upload the application, it is required to build the application, e.g. via `npmExecute`
or `mtaBuild`. The content of the app needs to be provided in a folder named `dist` in the root level of the project.
Although the name of the step `transportRequestUploadFile` might suggest something else, in this case a folder needs
to be provided. The application, which is provided in the `dist` folder is zipped and uploaded by the fiori toolset
used for performing the upload.
For `CTS` related uploads we use a node based toolset. When running in a docker environment a standard node
image can be used. In this case the required deploy tool dependencies will be installed prior to the deploy.
It is also possible to provide a docker image which already contains the required deploy tool
dependencies (`config.changeManagement.cts.nodeDocker.image`). In this case an empty list needs to be provided
as `config.changeManagement.cts.deployToolDependencies`. Using an already pre-configured docker image speeds-up
the deployment step, but comes with the disadvantage of having
to maintain and provision the corresponding docker image.
When running in an environment without docker, it is recommanded to install the deploy tools manually on the
system and to provide an empty list for the deploy tool dependencies (`config.changeManagement.cts.deployToolDependencies`).
### Examples
#### Upload based on preconfigured image
```groovy
transportRequestUploadFile script: this,
changeManagement: [
credentialsId: 'CRED_ID', // credentials needs to be defined inside Jenkins
type: 'CTS',
endpoint: 'https://example.org:8000',
client: '001',
cts: [
nodeDocker: [
image: 'docker-image-name',
pullImage: true, // needs to be set to false in case the image is
// only available in the local docker cache (not recommended)
],
npmInstallOpts: [],
deployToolDependencies: [], // empty since we use an already preconfigured image
],
],
applicationName: 'APP',
abapPackage: 'ABABPACKAGE',
transportRequestId: 'XXXK123456', // can be omitted when resolved via commit history
applicationDescription: 'An optional description' // only used in case a new application is deployed
// description is not updated for re-deployments
}
```
#### Upload based on a standard node image
```groovy
transportRequestUploadFile script: this,
changeManagement: [
credentialsId: 'CRED_ID', // credentials needs to be defined inside Jenkins
type: 'CTS',
endpoint: 'https://example.org:8000',
client: '001',
cts: [
npmInstallOpts: [
'--verbose', // might be benefical for troubleshooting
'--registry', 'https://your.npmregistry.org/', // an own registry can be specified here
],
],
],
applicationName: 'APP',
abapPackage: 'ABABPACKAGE',
transportRequestId: 'XXXK123456', // can be omitted when resolved via commit history
applicationDescription: 'An optional description' // only used in case a new application is deployed
// description is not updated for re-deployments
}
```
## Exceptions
* `IllegalArgumentException`:
@ -91,15 +165,15 @@ transportRequestUploadFile(
)
// CTS
// NOTE: CTS upload currently not supported!
transportRequestUploadFile(
script: this,
transportRequestId: '001', // typically provided via git commit history
filePath: '/path',
changeManagement: [
type: 'CTS'
endpoint: 'https://example.org/cm'
]
endpoint: 'https://example.org/cm',
client: '099',
],
applicationName: 'myApp',
abapPackage: 'MYPACKAGE',
)
```