release transport request for cts

This commit is contained in:
Marcus Holl
2019-03-19 10:07:18 +01:00
parent 3e8d4fc576
commit bdc0e487d6
4 changed files with 19 additions and 1 deletions
+2 -1
View File
@@ -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,
@@ -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',
@@ -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
+1
View File
@@ -111,6 +111,7 @@ void call(parameters = [:]) {
case BackendType.CTS:
cm.releaseTransportRequestCTS(
configuration.changeManagement.cts.docker,
configuration.transportRequestId,
configuration.changeManagement.endpoint,
configuration.changeManagement.credentialsId,