diff --git a/src/com/sap/piper/cm/ChangeManagement.groovy b/src/com/sap/piper/cm/ChangeManagement.groovy index 0bba3d7c9..c86f6b7f3 100644 --- a/src/com/sap/piper/cm/ChangeManagement.groovy +++ b/src/com/sap/piper/cm/ChangeManagement.groovy @@ -355,6 +355,7 @@ public class ChangeManagement implements Serializable { } void releaseTransportRequestCTS( + Map docker, String transportRequestId, String endpoint, String credentialsId, @@ -368,7 +369,7 @@ public class ChangeManagement implements Serializable { int rc = executeWithCredentials( BackendType.CTS, - [:], + docker, endpoint, credentialsId, cmd, diff --git a/test/groovy/TransportRequestReleaseTest.groovy b/test/groovy/TransportRequestReleaseTest.groovy index 2eb808fb4..1ea96ba61 100644 --- a/test/groovy/TransportRequestReleaseTest.groovy +++ b/test/groovy/TransportRequestReleaseTest.groovy @@ -127,6 +127,7 @@ public class TransportRequestReleaseTest extends BasePiperTest { ChangeManagement cm = new ChangeManagement(nullScript) { void releaseTransportRequestCTS( + Map docker, String transportRequestId, String endpoint, String credentialsId, @@ -230,12 +231,14 @@ public class TransportRequestReleaseTest extends BasePiperTest { ChangeManagement cm = new ChangeManagement(nullScript) { void releaseTransportRequestCTS( + Map docker, String transportRequestId, String endpoint, String credentialsId, String clientOpts = '') { receivedParameters = [ + docker: docker, transportRequestId: transportRequestId, endpoint: endpoint, credentialsId: credentialsId, @@ -250,6 +253,12 @@ public class TransportRequestReleaseTest extends BasePiperTest { cmUtils: cm) assert receivedParameters == [ + docker: [ + image:'ppiper/cm-client', + options:[], + envVars:[:], + pullImage:true, + ], transportRequestId: '002', endpoint: 'https://example.org/cts', credentialsId: 'CM', diff --git a/test/groovy/com/sap/piper/cm/ChangeManagementTest.groovy b/test/groovy/com/sap/piper/cm/ChangeManagementTest.groovy index 1a1fc8c73..e10ca57e9 100644 --- a/test/groovy/com/sap/piper/cm/ChangeManagementTest.groovy +++ b/test/groovy/com/sap/piper/cm/ChangeManagementTest.groovy @@ -424,6 +424,10 @@ public void testGetCommandLineWithCMClientOpts() { script.setReturnValue(JenkinsShellCallRule.Type.REGEX, '-t CTS export-transport.*-tID 002', 0) new ChangeManagement(nullScript).releaseTransportRequestCTS( + [ + image: 'ppiper/cm-client', + pullImage: true, + ], '002', 'https://example.org', 'me', @@ -431,6 +435,9 @@ public void testGetCommandLineWithCMClientOpts() { // no assert required here, since the regex registered above to the script rule is an implicit check for // the command line. + + assert dockerExecuteRule.getDockerParams().dockerImage == 'ppiper/cm-client' + assert dockerExecuteRule.getDockerParams().dockerPullImage == true } @Test diff --git a/vars/transportRequestRelease.groovy b/vars/transportRequestRelease.groovy index b2acf002b..c7da5876a 100644 --- a/vars/transportRequestRelease.groovy +++ b/vars/transportRequestRelease.groovy @@ -111,6 +111,7 @@ void call(parameters = [:]) { case BackendType.CTS: cm.releaseTransportRequestCTS( + configuration.changeManagement.cts.docker, configuration.transportRequestId, configuration.changeManagement.endpoint, configuration.changeManagement.credentialsId,