1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

Verbose flag for transportRequestCreate

This commit is contained in:
Marcus Holl 2019-03-05 10:29:23 +01:00
parent e8baa5b732
commit ad3e0f86d1
5 changed files with 22 additions and 8 deletions

View File

@ -362,6 +362,7 @@ steps:
failIfStatusIsNotInDevelopment: true
transportRequestCreate:
developmentSystemId: null
verbose: false
transportRequestUploadFile:
acceptUnixStyleLineEndings: true
codePage: 'UTF-8'

View File

@ -107,13 +107,15 @@ public class ChangeManagement implements Serializable {
String developmentClient,
String developmentInstance,
String credentialsId,
String description) {
String description,
boolean verbose) {
def command = 'cts createTransportRequest'
def args = [
TRANSPORT_DESCRIPTION: description,
ABAP_DEVELOPMENT_INSTANCE: developmentInstance,
ABAP_DEVELOPMENT_CLIENT: developmentClient,
VERBOSE: verbose,
]
try {

View File

@ -205,7 +205,8 @@ public class TransportRequestCreateTest extends BasePiperTest {
String developmentClient,
String developmentInstance,
String credentialsId,
String description) {
String description,
boolean verbose) {
result.docker = docker
result.endpoint = endpoint
@ -213,6 +214,7 @@ public class TransportRequestCreateTest extends BasePiperTest {
result.developmentInstance= developmentInstance
result.credentialsId = credentialsId
result.description = description
result.verbose = verbose
return '001'
}
@ -230,7 +232,8 @@ public class TransportRequestCreateTest extends BasePiperTest {
],
developmentSystemId: '001',
description: '',
cmUtils: cm)
cmUtils: cm,
verbose: true)
assert nullScript.commonPipelineEnvironment.getTransportRequestId() == '001'
assert result == [
@ -244,7 +247,8 @@ public class TransportRequestCreateTest extends BasePiperTest {
developmentClient: '01',
developmentInstance: '001',
credentialsId: 'CM',
description: ''
description: '',
verbose: true
]
assert loggingRule.log.contains("[INFO] Creating transport request.")
@ -265,7 +269,8 @@ public class TransportRequestCreateTest extends BasePiperTest {
String developmentClient,
String developmentInstance,
String credentialsId,
String description) {
String description,
boolean verbose) {
throw new ChangeManagementException('upload failed')
}

View File

@ -182,7 +182,8 @@ public void testGetCommandLineWithCMClientOpts() {
'01', // client
'001', // instance
'me', // credentialsId
'Lorem ipsum' // description
'Lorem ipsum', // description
true // verbose
)
assert dockerExecuteRule.dockerParams.dockerImage == 'rfc'
@ -194,6 +195,7 @@ public void testGetCommandLineWithCMClientOpts() {
ABAP_DEVELOPMENT_SERVER: 'https://example.org/rfc',
ABAP_DEVELOPMENT_USER: 'user',
ABAP_DEVELOPMENT_PASSWORD: 'password',
VERBOSE: true
]
assert transportRequestId == 'XYZK9000004'
@ -215,7 +217,8 @@ public void testGetCommandLineWithCMClientOpts() {
'01', // client
'001', // instance
'me', // credentialsId
'Lorem ipsum' // description
'Lorem ipsum', // description
true, //verbose
)
}

View File

@ -23,6 +23,7 @@ import hudson.AbortException
'developmentSystemId', // SOLMAN
'targetSystem', // CTS
'transportType', // CTS
'verbose', // RFC
]
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS.plus(['changeDocumentId'])
@ -63,6 +64,7 @@ void call(parameters = [:]) {
.withMandatoryProperty('description', null, { backendType == BackendType.CTS})
.withMandatoryProperty('changeManagement/rfc/developmentInstance', null, {backendType == BackendType.RFC})
.withMandatoryProperty('changeManagement/rfc/developmentClient', null, {backendType == BackendType.RFC})
.withMandatoryProperty('verbose', null, {backendType == BackendType.RFC})
def changeDocumentId = null
@ -115,7 +117,8 @@ void call(parameters = [:]) {
configuration.changeManagement.rfc.developmentInstance,
configuration.changeManagement.rfc.developmentClient,
configuration.changeManagement.credentialsId,
configuration.description)
configuration.description,
configuration.verbose)
} else {
throw new IllegalArgumentException("Invalid backend type: '${backendType}'.")
}