2019-03-28 10:10:01 +01:00
|
|
|
# ${docGenStepName}
|
2018-06-20 11:46:28 +02:00
|
|
|
|
2019-03-28 10:10:01 +01:00
|
|
|
## ${docGenDescription}
|
2018-06-20 11:46:28 +02:00
|
|
|
|
|
|
|
## Prerequisites
|
2018-11-06 13:50:09 +01:00
|
|
|
|
2021-01-14 09:35:31 +01:00
|
|
|
* No prerequisites
|
2018-06-20 11:46:28 +02:00
|
|
|
|
2019-03-28 10:10:01 +01:00
|
|
|
## ${docGenParameters}
|
|
|
|
|
|
|
|
## ${docGenConfiguration}
|
2018-11-06 13:50:09 +01:00
|
|
|
|
2019-05-24 15:44:31 +02:00
|
|
|
## ${docJenkinsPluginDependencies}
|
2019-05-24 15:41:49 +02:00
|
|
|
|
2018-07-17 09:21:56 +02:00
|
|
|
The step is configured using a customer configuration file provided as
|
|
|
|
resource in an custom shared library.
|
|
|
|
|
2018-11-06 13:50:09 +01:00
|
|
|
```groovy
|
2018-12-05 13:37:15 +01:00
|
|
|
@Library('piper-lib-os@master') _
|
2018-07-17 09:21:56 +02:00
|
|
|
|
|
|
|
// the shared lib containing the additional configuration
|
|
|
|
// needs to be configured in Jenkins
|
2018-11-06 13:50:09 +01:00
|
|
|
@Library('foo@master') __
|
2018-07-17 09:21:56 +02:00
|
|
|
|
|
|
|
// inside the shared lib denoted by 'foo' the additional configuration file
|
|
|
|
// needs to be located under 'resources' ('resoures/myConfig.yml')
|
|
|
|
prepareDefaultValues script: this,
|
|
|
|
customDefaults: 'myConfig.yml'
|
|
|
|
```
|
|
|
|
|
2018-11-06 13:50:09 +01:00
|
|
|
Example content of `'resources/myConfig.yml'` in branch `'master'` of the repository denoted by
|
|
|
|
`'foo'`:
|
2018-07-17 09:21:56 +02:00
|
|
|
|
2018-11-06 13:50:09 +01:00
|
|
|
```yaml
|
2018-07-17 09:21:56 +02:00
|
|
|
general:
|
|
|
|
changeManagement:
|
|
|
|
changeDocumentLabel: 'ChangeDocument\s?:'
|
|
|
|
cmClientOpts: '-Djavax.net.ssl.trustStore=<path to truststore>'
|
|
|
|
credentialsId: 'CM'
|
2018-09-28 10:00:59 +02:00
|
|
|
type: 'SOLMAN'
|
2018-07-17 09:21:56 +02:00
|
|
|
endpoint: 'https://example.org/cm'
|
|
|
|
git:
|
|
|
|
from: 'HEAD~1'
|
|
|
|
to: 'HEAD'
|
|
|
|
format: '%b'
|
|
|
|
```
|
|
|
|
|
2020-09-24 07:41:06 +02:00
|
|
|
The properties configured in section `'general/changeManagement'` are shared between all change management related steps.
|
2018-06-20 11:46:28 +02:00
|
|
|
|
2018-07-17 09:21:56 +02:00
|
|
|
The properties can also be configured on a per-step basis:
|
|
|
|
|
2018-11-06 13:50:09 +01:00
|
|
|
```yaml
|
2018-07-17 09:21:56 +02:00
|
|
|
[...]
|
|
|
|
steps:
|
|
|
|
transportRequestUploadFile:
|
|
|
|
applicationId: 'FOO'
|
|
|
|
changeManagement:
|
2018-09-28 10:00:59 +02:00
|
|
|
type: 'SOLMAN'
|
2018-07-17 09:21:56 +02:00
|
|
|
endpoint: 'https://example.org/cm'
|
|
|
|
[...]
|
|
|
|
```
|
|
|
|
|
|
|
|
The parameters can also be provided when the step is invoked. For examples see below.
|
2018-06-20 11:46:28 +02:00
|
|
|
|
2020-10-21 12:04:11 +02:00
|
|
|
## 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
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
2018-06-20 11:46:28 +02:00
|
|
|
## Exceptions
|
2018-11-06 13:50:09 +01:00
|
|
|
|
2018-07-17 09:21:56 +02:00
|
|
|
* `IllegalArgumentException`:
|
2018-11-06 13:50:09 +01:00
|
|
|
* If the change id is not provided (`SOLMAN` only).
|
|
|
|
* If the transport request id is not provided.
|
|
|
|
* If the application id is not provided (`SOLMAN` only).
|
|
|
|
* If the file path is not provided.
|
2018-07-17 09:21:56 +02:00
|
|
|
* `AbortException`:
|
2018-11-06 13:50:09 +01:00
|
|
|
* If the upload fails.
|
2018-06-20 11:46:28 +02:00
|
|
|
|
|
|
|
## Example
|
2018-11-06 13:50:09 +01:00
|
|
|
|
2018-06-20 11:46:28 +02:00
|
|
|
```groovy
|
2018-09-28 10:00:59 +02:00
|
|
|
// SOLMAN
|
2019-05-17 13:20:13 +02:00
|
|
|
transportRequestUploadFile(
|
|
|
|
script: this,
|
|
|
|
changeDocumentId: '001', // typically provided via git commit history
|
|
|
|
transportRequestId: '001', // typically provided via git commit history
|
|
|
|
applicationId: '001',
|
|
|
|
filePath: '/path',
|
|
|
|
changeManagement: [
|
|
|
|
type: 'SOLMAN'
|
|
|
|
endpoint: 'https://example.org/cm'
|
|
|
|
]
|
|
|
|
)
|
2018-09-28 10:00:59 +02:00
|
|
|
// CTS
|
2020-06-16 08:13:49 +02:00
|
|
|
|
2019-05-17 13:20:13 +02:00
|
|
|
transportRequestUploadFile(
|
|
|
|
script: this,
|
|
|
|
transportRequestId: '001', // typically provided via git commit history
|
|
|
|
changeManagement: [
|
|
|
|
type: 'CTS'
|
2020-10-21 12:04:11 +02:00
|
|
|
endpoint: 'https://example.org/cm',
|
|
|
|
client: '099',
|
|
|
|
],
|
|
|
|
applicationName: 'myApp',
|
|
|
|
abapPackage: 'MYPACKAGE',
|
2019-05-17 13:20:13 +02:00
|
|
|
)
|
2018-06-20 11:46:28 +02:00
|
|
|
```
|