1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-11-24 08:32:32 +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(
Map docker,
String changeId,
String transportRequestId,
String endpoint,
@ -340,7 +341,7 @@ public class ChangeManagement implements Serializable {
int rc = executeWithCredentials(
BackendType.SOLMAN,
[:],
docker,
endpoint,
credentialsId,
cmd,

View File

@ -97,6 +97,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
ChangeManagement cm = new ChangeManagement(nullScript) {
void releaseTransportRequestSOLMAN(
Map docker,
String changeId,
String transportRequestId,
String endpoint,
@ -374,12 +375,14 @@ public class TransportRequestReleaseTest extends BasePiperTest {
ChangeManagement cm = new ChangeManagement(nullScript) {
void releaseTransportRequestSOLMAN(
Map docker,
String changeId,
String transportRequestId,
String endpoint,
String credentialsId,
String clientOpts) {
receivedParams.docker = docker
receivedParams.changeId = changeId
receivedParams.transportRequestId = transportRequestId
receivedParams.endpoint = endpoint
@ -391,6 +394,12 @@ public class TransportRequestReleaseTest extends BasePiperTest {
stepRule.step.transportRequestRelease(script: nullScript, changeDocumentId: '001', transportRequestId: '002', cmUtils: cm)
assert receivedParams == [
docker: [
image: 'ppiper/cm-client',
pullImage: true,
envVars: [:],
options: [],
],
changeId: '001',
transportRequestId: '002',
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)
new ChangeManagement(nullScript).releaseTransportRequestSOLMAN(
[
image: 'ppiper/cm-client',
imagePull: true,
],
'001',
'002',
'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
// the command line.
dockerExecuteRule.getDockerParams().dockerImage == 'ppiper/cm-client'
dockerExecuteRule.getDockerParams().pullImage == true
}
@Test
@ -460,6 +467,10 @@ public void testGetCommandLineWithCMClientOpts() {
script.setReturnValue(JenkinsShellCallRule.Type.REGEX, 'release-transport.*-cID 001.*-tID 002', 1)
new ChangeManagement(nullScript).releaseTransportRequestSOLMAN(
[
image: 'ppiper/cm-client',
imagePull: true,
],
'001',
'002',
'https://example.org',

View File

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