mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-03 15:02:35 +02:00
docker for transportRequestCreate CTS
This commit is contained in:
parent
94315bf006
commit
620e0c7d4a
@ -77,9 +77,9 @@ public class ChangeManagement implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
String createTransportRequestCTS(String transportType, String targetSystemId, String description, String endpoint, String credentialsId, String clientOpts = '') {
|
||||
String createTransportRequestCTS(Map docker, String transportType, String targetSystemId, String description, String endpoint, String credentialsId, String clientOpts = '') {
|
||||
try {
|
||||
def transportRequest = executeWithCredentials(BackendType.CTS, [:], endpoint, credentialsId, 'create-transport',
|
||||
def transportRequest = executeWithCredentials(BackendType.CTS, docker, endpoint, credentialsId, 'create-transport',
|
||||
['-tt', transportType, '-ts', targetSystemId, '-d', "\"${description}\""],
|
||||
true,
|
||||
clientOpts)
|
||||
|
@ -156,12 +156,14 @@ public class TransportRequestCreateTest extends BasePiperTest {
|
||||
ChangeManagement cm = new ChangeManagement(nullScript) {
|
||||
|
||||
String createTransportRequestCTS(
|
||||
Map docker,
|
||||
String transportType,
|
||||
String targetSystemId,
|
||||
String description,
|
||||
String endpoint,
|
||||
String credentialsId,
|
||||
String clientOpts) {
|
||||
result.docker = docker
|
||||
result.transportType = transportType
|
||||
result.targetSystemId = targetSystemId
|
||||
result.description = description
|
||||
@ -180,7 +182,14 @@ public class TransportRequestCreateTest extends BasePiperTest {
|
||||
cmUtils: cm)
|
||||
|
||||
assert nullScript.commonPipelineEnvironment.getTransportRequestId() == '001'
|
||||
assert result == [transportType: 'W',
|
||||
assert result == [
|
||||
docker: [
|
||||
image: 'ppiper/cm-client',
|
||||
pullImage: true,
|
||||
envVars: [:],
|
||||
options: [],
|
||||
],
|
||||
transportType: 'W',
|
||||
targetSystemId: 'XYZ',
|
||||
description: 'desc',
|
||||
endpoint: 'https://example.org/cm',
|
||||
|
@ -228,6 +228,10 @@ public void testGetCommandLineWithCMClientOpts() {
|
||||
script.setReturnValue(JenkinsShellCallRule.Type.REGEX, 'cmclient.* -t CTS .*create-transport -tt W -ts XYZ -d "desc 123"$', '004')
|
||||
def transportRequestId = new ChangeManagement(nullScript)
|
||||
.createTransportRequestCTS(
|
||||
[
|
||||
image: 'ppiper/cmclient',
|
||||
pullImage: true
|
||||
],
|
||||
'W', // transport type
|
||||
'XYZ', // target system
|
||||
'desc 123', // description
|
||||
@ -238,6 +242,9 @@ public void testGetCommandLineWithCMClientOpts() {
|
||||
// returned only in case the shell call matches.
|
||||
assert transportRequestId == '004'
|
||||
|
||||
dockerExecuteRule.getDockerParams().dockerImage = 'ppiper/cmclient'
|
||||
dockerExecuteRule.getDockerParams().dockerPullImage = true
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -104,6 +104,7 @@ void call(parameters = [:]) {
|
||||
configuration.changeManagement.clientOpts)
|
||||
} else if(backendType == BackendType.CTS) {
|
||||
transportRequestId = cm.createTransportRequestCTS(
|
||||
configuration.changeManagement.cts.docker,
|
||||
configuration.transportType,
|
||||
configuration.targetSystem,
|
||||
configuration.description,
|
||||
|
Loading…
x
Reference in New Issue
Block a user