Skip to content

Commit

Permalink
Merge 87aafb3 into ced7323
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusholl committed Sep 28, 2018
2 parents ced7323 + 87aafb3 commit 4973147
Show file tree
Hide file tree
Showing 13 changed files with 544 additions and 146 deletions.
36 changes: 30 additions & 6 deletions documentation/docs/steps/transportRequestCreate.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# transportRequestCreate

## Description
Creates a Transport Request for a Change Document on the Solution Manager.
Creates

* a Transport Request for a Change Document on the Solution Manager (type `SOLMAN`) or
* a Transport Request inside an ABAP system (type`CTS`)

## Prerequisites
* **[Change Management Client 2.0.0 or compatible version](http://central.maven.org/maven2/com/sap/devops/cmclient/dist.cli/)** - available for download on Maven Central.
Expand All @@ -10,24 +13,32 @@ Creates a Transport Request for a Change Document on the Solution Manager.
| parameter | mandatory | default | possible values |
| -----------------|-----------|--------------------------------------------------------|--------------------|
| `script` | yes | | |
| `changeDocumentId` | yes | | |
| `changeDocumentId` | for `SOLMAN` | | |
| `transportType` | for `CTS` | no | |
| `targetSystem` | for `CTS` | no | |
| `description` | for `CTS` | no | |
| `changeManagement/credentialsId` | yes | | |
| `changeManagement/endpoint` | yes | | |
| `changeManagement/clientOpts` | no | | |
| `changeManagement/git/from` | no | `origin/master` | |
| `changeManagement/git/to` | no | `HEAD` | |
| `changeManagement/changeDocumentLabel` | no | `ChangeDocument\s?:` | regex pattern |
| `changeManagement/git/format` | no | `%b` | see `git log --help` |
| `changeManagement/type` | no | `SOLMAN` | `SOLMAN`, `CTS` |

* `script` - The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the `this` parameter, as in `script: this`. This allows the function to access the [`commonPipelineEnvironment`](commonPipelineEnvironment.md) for retrieving, for example, configuration parameters.
* `changeDocumentId` - The id of the change document to transport.
* `changeManagement/credentialsId` - The credentials to connect to the Solution Manager.
* `changeManagement/endpoint` - The address of the Solution Manager.
* `changeDocumentId` - for `SOLMAN` only. The id of the change document to that the transport request is bound to. Typically this value is provided via commit message in the commit history.
* `changeManagement/type` Where/how the transport request is created (via SAP Solution Manager, ABAP).
* `changeManagement/credentialsId` - The credentials to connect to the service endpoint (Solution Manager, ABAP System).
* `changeManagement/endpoint` - The service endpoint (Solution Manager, ABAP System).
* `changeManagement/clientOpts`- Options forwarded to JVM used by the CM client, like `JAVA_OPTS`
* `changeManagement/git/from` - The starting point for retrieving the change document id
* `changeManagement/git/to` - The end point for retrieving the change document id
* `changeManagement/changeDocumentLabel` - A pattern used for identifying lines holding the change document id.
* `changeManagement/changeDocumentLabel` - For type `SOLMAN` only. A pattern used for identifying lines holding the change document id.
* `changeManagement/git/format` - Specifies what part of the commit is scanned. By default the body of the commit message is scanned.
* `description` - for `CTS` only. The description of the transport request.
* `targetSystem` - for `CTS` only. The system receiving the transport request.
* `transportType` - for type `CTS` only. Typically `W` (workbench) or `C` customizing.

## Step configuration
The step is configured using a customer configuration file provided as
Expand Down Expand Up @@ -55,6 +66,7 @@ general:
changeDocumentLabel: 'ChangeDocument\s?:'
cmClientOpts: '-Djavax.net.ssl.trustStore=<path to truststore>'
credentialsId: 'CM'
type: 'SOLMAN'
endpoint: 'https://example.org/cm'
git:
from: 'HEAD~1'
Expand All @@ -72,6 +84,7 @@ The properties can also be configured on a per-step basis:
steps:
transportRequestCreate:
changeManagement:
type: 'SOLMAN'
endpoint: 'https://example.org/cm'
[...]
```
Expand All @@ -89,9 +102,20 @@ The id of the Transport Request that has been created.

## Example
```groovy
// SOLMAN
def transportRequestId = transportRequestCreate script:this,
changeDocumentId: '001,'
changeManagement: [
type: 'SOLMAN'
endpoint: 'https://example.org/cm'
]
// CTS
def transportRequestId = transportRequestCreate script:this,
transportType: 'W',
targetSystem: 'XYZ',
description: 'the description',
changeManagement: [
type: 'CTS'
endpoint: 'https://example.org/cm'
]
```
Expand Down
30 changes: 21 additions & 9 deletions documentation/docs/steps/transportRequestRelease.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# transportRequestRelease

## Description
Releases a Transport Request for a Change Document on the Solution Manager.
Releases a Transport Request.

## Prerequisites
* **[Change Management Client 2.0.0 or compatible version](http://central.maven.org/maven2/com/sap/devops/cmclient/dist.cli/)** - available for download on Maven Central.
Expand All @@ -10,7 +10,7 @@ Releases a Transport Request for a Change Document on the Solution Manager.
| parameter | mandatory | default | possible values |
| -----------------|-----------|--------------------------------------------------------|--------------------|
| `script` | yes | | |
| `changeDocumentId` | yes | | |
| `changeDocumentId` | `SOLMAN` only | | |
| `transportRequestId`| yes | | |
| `changeManagement/changeDocumentLabel` | no | `ChangeDocument\s?:` | regex pattern |
| `changeManagment/transportRequestLabel` | no | `TransportRequest\s?:` | regex pattern |
Expand All @@ -19,16 +19,17 @@ Releases a Transport Request for a Change Document on the Solution Manager.
| `changeManagement/git/from` | no | `origin/master` | |
| `changeManagement/git/to` | no | `HEAD` | |
| `changeManagement/git/format` | no | `%b` | see `git log --help` |
| `changeManagement/type` | no | `SOLMAN` | `SOLMAN`, `CTS` |

* `script` - The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the `this` parameter, as in `script: this`. This allows the function to access the [`commonPipelineEnvironment`](commonPipelineEnvironment.md) for retrieving, for example, configuration parameters.
* `changeDocumentId` - The id of the change document related to the transport request to release.
* `changeDocumentId` - for `SOLMAN` only. The id of the change document related to the transport request to release.
* `transportRequestId` - The id of the transport request to release.
* `changeManagement/changeDocumentLabel` - A pattern used for identifying lines holding the change document id.
* `changeManagement/changeDocumentLabel` - for `SOLMAN` only. A pattern used for identifying lines holding the change document id.
* `changeManagment/transportRequestLabel` - A pattern used for identifying lines holding the transport request id.
* `changeManagement/credentialsId` - The id of the credentials to connect to the Solution Manager. The credentials needs to be maintained on Jenkins.
* `changeManagement/endpoint` - The address of the Solution Manager.
* `changeManagement/git/from` - The starting point for retrieving the change document id
* `changeManagement/git/to` - The end point for retrieving the change document id
* `changeManagement/credentialsId` - The credentials to connect to the service endpoint (Solution Manager, ABAP System).
* `changeManagement/endpoint` - The service endpoint (Solution Manager, ABAP System).
* `changeManagement/git/from` - The starting point for retrieving the change document id and/or transport request id
* `changeManagement/git/to` - The end point for retrieving the change document id and/or transport request id
* `changeManagement/git/format` - Specifies what part of the commit is scanned. By default the body of the commit message is scanned.

## Step configuration
Expand Down Expand Up @@ -57,6 +58,7 @@ general:
changeDocumentLabel: 'ChangeDocument\s?:'
cmClientOpts: '-Djavax.net.ssl.trustStore=<path to truststore>'
credentialsId: 'CM'
type: 'SOLMAN'
endpoint: 'https://example.org/cm'
git:
from: 'HEAD~1'
Expand All @@ -73,6 +75,7 @@ The properties can also be configured on a per-step basis:
steps:
transportRequestRelease:
changeManagement:
type: 'SOLMAN'
endpoint: 'https://example.org/cm'
[...]
```
Expand All @@ -84,17 +87,26 @@ None.

## Exceptions
* `IllegalArgumentException`:
* If the change id is not provided.
* If the change id is not provided (`SOLMAN` only)
* If the transport request id is not provided.
* `AbortException`:
* If the release of the transport request fails.

## Example
```groovy
// SOLMAN
transportRequestRelease script:this,
changeDocumentId: '001',
transportRequestId: '001',
changeManagement: [
type: 'SOLMAN'
endpoint: 'https://example.org/cm'
]
// CTS
transportRequestRelease script:this,
transportRequestId: '001',
changeManagement: [
type: 'CTS'
endpoint: 'https://example.org/cm'
]
```
Expand Down
44 changes: 29 additions & 15 deletions documentation/docs/steps/transportRequestUploadFile.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# transportRequestUploadFile

## Description
Uploads a file to a Transport Request for a Change Document on the Solution Manager.
Uploads a file to a Transport Request.

## Prerequisites
* **[Change Management Client 2.0.0 or compatible version](http://central.maven.org/maven2/com/sap/devops/cmclient/dist.cli/)** - available for download on Maven Central.
Expand All @@ -10,9 +10,9 @@ Uploads a file to a Transport Request for a Change Document on the Solution Mana
| parameter | mandatory | default | possible values |
| -----------------|-----------|--------------------------------------------------------|--------------------|
| `script` | yes | | |
| `changeDocumentId` | yes | | |
| `changeDocumentId` | `SOLMAN` only | | |
| `transportRequestId`| yes | | |
| `applicationId` | yes | | |
| `applicationId` | `SOLMAN` only | | |
| `filePath` | yes | | |
| `changeManagement/credentialsId` | yes | | |
| `changeManagement/endpoint` | yes | | |
Expand All @@ -21,18 +21,20 @@ Uploads a file to a Transport Request for a Change Document on the Solution Mana
| `changeManagement/changeDocumentLabel` | no | `ChangeDocument\s?:` | regex pattern |
| `changeManagement/transportRequestLabel` | no | `TransportRequest\s?:` | regex pattern |
| `changeManagement/git/format` | no | `%b` | see `git log --help` |
| `changeManagement/type` | no | `SOLMAN` | `SOLMAN`, `CTS` |

* `script` - The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the `this` parameter, as in `script: this`. This allows the function to access the [`commonPipelineEnvironment`](commonPipelineEnvironment.md) for retrieving, for example, configuration parameters.
* `changeDocumentId` - The id of the change document related to the transport request to release.
* `transportRequestId` - The id of the transport request to release.
* `applicationId` - The id of the application.
* `changeDocumentId` - For type `SOLMAN` only. The id of the change document related to the transport request to release. Typically provided via commit history.
* `transportRequestId` - The id of the transport request to release. Typically provided via commit history.
* `applicationId` - For type `SOLMAN` only. The id of the application.
* `filePath` - The path of the file to upload.
* `changeManagement/credentialsId` - The credentials to connect to the Solution Manager.
* `changeManagement/endpoint` - The address of the Solution Manager.
* `changeManagement/git/from` - The starting point for retrieving the change document id
* `changeManagement/git/to` - The end point for retrieving the change document id
* `changeManagement/changeDocumentLabel` - A pattern used for identifying lines holding the change document id.
* `changeManagement/credentialsId` - The credentials to connect to the service endpoint (Solution Manager, ABAP System).
* `changeManagement/endpoint` - The service endpoint (Solution Manager, ABAP System).
* `changeManagement/git/from` - The starting point for retrieving the change document id and/or transport request id
* `changeManagement/git/to` - The end point for retrieving the change document id and/or transport request id
* `changeManagement/changeDocumentLabel` - For type `SOLMAN` only. A pattern used for identifying lines holding the change document id.
* `changeManagement/transportRequestLabel` - A pattern used for identifying lines holding the transport request id.
* `changeManagement/type` Where/how the transport request is created (via SAP Solution Manager, ABAP).
* `changeManagement/git/format` - Specifies what part of the commit is scanned. By default the body of the commit message is scanned.

## Step configuration
Expand Down Expand Up @@ -61,6 +63,7 @@ general:
changeDocumentLabel: 'ChangeDocument\s?:'
cmClientOpts: '-Djavax.net.ssl.trustStore=<path to truststore>'
credentialsId: 'CM'
type: 'SOLMAN'
endpoint: 'https://example.org/cm'
git:
from: 'HEAD~1'
Expand All @@ -78,6 +81,7 @@ The properties can also be configured on a per-step basis:
transportRequestUploadFile:
applicationId: 'FOO'
changeManagement:
type: 'SOLMAN'
endpoint: 'https://example.org/cm'
[...]
```
Expand All @@ -89,21 +93,31 @@ None.

## Exceptions
* `IllegalArgumentException`:
* If the change id is not provided.
* If the change id is not provided (`SOLMAN` only).
* If the transport request id is not provided.
* If the application id is not provided.
* If the application id is not provided (`SOLMAN` only).
* If the file path is not provided.
* `AbortException`:
* If the upload fails.

## Example
```groovy
// SOLMAN
transportRequestUploadFile script:this,
changeDocumentId: '001',
transportRequestId: '001',
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'
]
// CTS
transportRequestUploadFile script:this,
transportRequestId: '001', // typically provided via git commit history
filePath: '/path',
changeManagement:[
type: 'CTS'
endpoint: 'https://example.org/cm'
]
```
Expand Down
1 change: 1 addition & 0 deletions resources/default_pipeline_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ general:
productiveBranch: 'master'
collectTelemetryData: true
changeManagement:
type: 'SOLMAN' # SOLMAN, CTS
transportRequestLabel: 'TransportRequest\s?:'
changeDocumentLabel: 'ChangeDocument\s?:'
clientOpts: ''
Expand Down
5 changes: 5 additions & 0 deletions src/com/sap/piper/cm/BackendType.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.sap.piper.cm;

public enum BackendType {
SOLMAN, CTS, NONE
}
Loading

0 comments on commit 4973147

Please sign in to comment.