mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
Support cmclientOpts for uploadFileToTransport
This commit is contained in:
parent
875d221cc3
commit
d8d2249862
@ -90,13 +90,14 @@ public class ChangeManagement implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
void uploadFileToTransportRequest(String changeId, String transportRequestId, String applicationId, String filePath, String endpoint, String username, String password) {
|
||||
void uploadFileToTransportRequest(String changeId, String transportRequestId, String applicationId, String filePath, String endpoint, String username, String password, String cmclientOpts = '') {
|
||||
|
||||
int rc = script.sh(returnStatus: true,
|
||||
script: getCMCommandLine(endpoint, username, password,
|
||||
'upload-file-to-transport', ['-cID', changeId,
|
||||
'-tID', transportRequestId,
|
||||
applicationId, filePath]))
|
||||
applicationId, filePath],
|
||||
cmclientOpts))
|
||||
|
||||
if(rc == 0) {
|
||||
return
|
||||
|
@ -103,7 +103,8 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
|
||||
String filePath,
|
||||
String endpoint,
|
||||
String username,
|
||||
String password) {
|
||||
String password,
|
||||
String cmclientOpts) {
|
||||
throw new ChangeManagementException('Exception message')
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import hudson.AbortException
|
||||
|
||||
@Field Set parameterKeys = [
|
||||
'changeDocumentId',
|
||||
'cmClientOpts',
|
||||
'transportRequestId',
|
||||
'applicationId',
|
||||
'filePath',
|
||||
@ -21,6 +22,7 @@ import hudson.AbortException
|
||||
|
||||
@Field Set generalConfigurationKeys = [
|
||||
'credentialsId',
|
||||
'cmClientOpts',
|
||||
'endpoint'
|
||||
]
|
||||
|
||||
@ -62,7 +64,7 @@ def call(parameters = [:]) {
|
||||
usernameVariable: 'username')]) {
|
||||
|
||||
try {
|
||||
cm.uploadFileToTransportRequest(changeDocumentId, transportRequestId, applicationId, filePath, endpoint, username, password)
|
||||
cm.uploadFileToTransportRequest(changeDocumentId, transportRequestId, applicationId, filePath, endpoint, username, password, configuration.cmClientOpts)
|
||||
} catch(ChangeManagementException ex) {
|
||||
throw new AbortException(ex.getMessage())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user