1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-06-04 23:27:39 +02:00

Release transport SOLMAN with docker

This commit is contained in:
Marcus Holl 2019-02-28 10:56:14 +01:00
parent 71fdcc3e53
commit 3e8d4fc576
4 changed files with 23 additions and 1 deletions

View File

@ -324,6 +324,7 @@ public class ChangeManagement implements Serializable {
} }
void releaseTransportRequestSOLMAN( void releaseTransportRequestSOLMAN(
Map docker,
String changeId, String changeId,
String transportRequestId, String transportRequestId,
String endpoint, String endpoint,
@ -340,7 +341,7 @@ public class ChangeManagement implements Serializable {
int rc = executeWithCredentials( int rc = executeWithCredentials(
BackendType.SOLMAN, BackendType.SOLMAN,
[:], docker,
endpoint, endpoint,
credentialsId, credentialsId,
cmd, cmd,

View File

@ -97,6 +97,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
ChangeManagement cm = new ChangeManagement(nullScript) { ChangeManagement cm = new ChangeManagement(nullScript) {
void releaseTransportRequestSOLMAN( void releaseTransportRequestSOLMAN(
Map docker,
String changeId, String changeId,
String transportRequestId, String transportRequestId,
String endpoint, String endpoint,
@ -374,12 +375,14 @@ public class TransportRequestReleaseTest extends BasePiperTest {
ChangeManagement cm = new ChangeManagement(nullScript) { ChangeManagement cm = new ChangeManagement(nullScript) {
void releaseTransportRequestSOLMAN( void releaseTransportRequestSOLMAN(
Map docker,
String changeId, String changeId,
String transportRequestId, String transportRequestId,
String endpoint, String endpoint,
String credentialsId, String credentialsId,
String clientOpts) { String clientOpts) {
receivedParams.docker = docker
receivedParams.changeId = changeId receivedParams.changeId = changeId
receivedParams.transportRequestId = transportRequestId receivedParams.transportRequestId = transportRequestId
receivedParams.endpoint = endpoint receivedParams.endpoint = endpoint
@ -391,6 +394,12 @@ public class TransportRequestReleaseTest extends BasePiperTest {
stepRule.step.transportRequestRelease(script: nullScript, changeDocumentId: '001', transportRequestId: '002', cmUtils: cm) stepRule.step.transportRequestRelease(script: nullScript, changeDocumentId: '001', transportRequestId: '002', cmUtils: cm)
assert receivedParams == [ assert receivedParams == [
docker: [
image: 'ppiper/cm-client',
pullImage: true,
envVars: [:],
options: [],
],
changeId: '001', changeId: '001',
transportRequestId: '002', transportRequestId: '002',
endpoint: 'https://example.org/cm', endpoint: 'https://example.org/cm',

View File

@ -400,6 +400,10 @@ public void testGetCommandLineWithCMClientOpts() {
script.setReturnValue(JenkinsShellCallRule.Type.REGEX, '-t SOLMAN release-transport.*-cID 001.*-tID 002', 0) script.setReturnValue(JenkinsShellCallRule.Type.REGEX, '-t SOLMAN release-transport.*-cID 001.*-tID 002', 0)
new ChangeManagement(nullScript).releaseTransportRequestSOLMAN( new ChangeManagement(nullScript).releaseTransportRequestSOLMAN(
[
image: 'ppiper/cm-client',
imagePull: true,
],
'001', '001',
'002', '002',
'https://example.org', 'https://example.org',
@ -408,6 +412,9 @@ public void testGetCommandLineWithCMClientOpts() {
// no assert required here, since the regex registered above to the script rule is an implicit check for // no assert required here, since the regex registered above to the script rule is an implicit check for
// the command line. // the command line.
dockerExecuteRule.getDockerParams().dockerImage == 'ppiper/cm-client'
dockerExecuteRule.getDockerParams().pullImage == true
} }
@Test @Test
@ -460,6 +467,10 @@ public void testGetCommandLineWithCMClientOpts() {
script.setReturnValue(JenkinsShellCallRule.Type.REGEX, 'release-transport.*-cID 001.*-tID 002', 1) script.setReturnValue(JenkinsShellCallRule.Type.REGEX, 'release-transport.*-cID 001.*-tID 002', 1)
new ChangeManagement(nullScript).releaseTransportRequestSOLMAN( new ChangeManagement(nullScript).releaseTransportRequestSOLMAN(
[
image: 'ppiper/cm-client',
imagePull: true,
],
'001', '001',
'002', '002',
'https://example.org', 'https://example.org',

View File

@ -100,6 +100,7 @@ void call(parameters = [:]) {
case BackendType.SOLMAN: case BackendType.SOLMAN:
cm.releaseTransportRequestSOLMAN( cm.releaseTransportRequestSOLMAN(
configuration.changeManagement.solman.docker,
configuration.changeDocumentId, configuration.changeDocumentId,
configuration.transportRequestId, configuration.transportRequestId,
configuration.changeManagement.endpoint, configuration.changeManagement.endpoint,