mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
Merge pull request #174 from marcusholl/pr/changeDocumentId
Change parameter name 'changeId' to 'changeDocumentId'
This commit is contained in:
commit
cb5a98bf11
@ -10,12 +10,12 @@ Creates a Transport Request for a Change Document on the Solution Manager.
|
||||
| parameter | mandatory | default | possible values |
|
||||
| -----------------|-----------|--------------------------------------------------------|--------------------|
|
||||
| `script` | yes | | |
|
||||
| `changeId` | yes | | |
|
||||
| `changeDocumentId` | yes | | |
|
||||
| `cmCredentialsId` | yes | | |
|
||||
| `cmEndpoint` | yes | | |
|
||||
|
||||
* `script` - The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the `this` parameter, as in `script: this`. This allows the function to access the [`commonPipelineEnvironment`](commonPipelineEnvironment.md) for retrieving, for example, configuration parameters.
|
||||
* `changeId` - The id of the change document to transport.
|
||||
* `changeDocumentId` - The id of the change document to transport.
|
||||
* `cmCredentialsId` - The credentials to connect to the Solution Manager.
|
||||
* `cmEndpoint` - The address of the Solution Manager.
|
||||
|
||||
@ -35,6 +35,6 @@ The id of the Transport Request that has been created.
|
||||
|
||||
## Example
|
||||
```groovy
|
||||
def transportRequestId = transportRequestCreate script:this, changeId: '001'
|
||||
def transportRequestId = transportRequestCreate script:this, changeDocumentId: '001'
|
||||
```
|
||||
|
||||
|
@ -10,13 +10,13 @@ Releases a Transport Request for a Change Document on the Solution Manager.
|
||||
| parameter | mandatory | default | possible values |
|
||||
| -----------------|-----------|--------------------------------------------------------|--------------------|
|
||||
| `script` | yes | | |
|
||||
| `changeId` | yes | | |
|
||||
| `changeDocumentId` | yes | | |
|
||||
| `transportRequestId`| yes | | |
|
||||
| `cmCredentialsId` | yes | | |
|
||||
| `cmEndpoint` | yes | | |
|
||||
|
||||
* `script` - The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the `this` parameter, as in `script: this`. This allows the function to access the [`commonPipelineEnvironment`](commonPipelineEnvironment.md) for retrieving, for example, configuration parameters.
|
||||
* `changeId` - The id of the change document related to the transport request to release.
|
||||
* `changeDocumentId` - The id of the change document related to the transport request to release.
|
||||
* `transportRequestId` - The id of the transport request to release.
|
||||
* `cmCredentialsId` - The credentials to connect to the Solution Manager.
|
||||
* `cmEndpoint` - The address of the Solution Manager.
|
||||
@ -38,6 +38,6 @@ None.
|
||||
|
||||
## Example
|
||||
```groovy
|
||||
transportRequestRelease script:this, changeId: '001', transportRequestId: '001'
|
||||
transportRequestRelease script:this, changeDocumentId: '001', transportRequestId: '001'
|
||||
```
|
||||
|
||||
|
@ -10,7 +10,7 @@ Uploads a file to a Transport Request for a Change Document on the Solution Mana
|
||||
| parameter | mandatory | default | possible values |
|
||||
| -----------------|-----------|--------------------------------------------------------|--------------------|
|
||||
| `script` | yes | | |
|
||||
| `changeId` | yes | | |
|
||||
| `changeDocumentId` | yes | | |
|
||||
| `transportRequestId`| yes | | |
|
||||
| `applicationId` | yes | | |
|
||||
| `filePath` | yes | | |
|
||||
@ -18,7 +18,7 @@ Uploads a file to a Transport Request for a Change Document on the Solution Mana
|
||||
| `cmEndpoint` | yes | | |
|
||||
|
||||
* `script` - The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the `this` parameter, as in `script: this`. This allows the function to access the [`commonPipelineEnvironment`](commonPipelineEnvironment.md) for retrieving, for example, configuration parameters.
|
||||
* `changeId` - The id of the change document related to the transport request to release.
|
||||
* `changeDocumentId` - The id of the change document related to the transport request to release.
|
||||
* `transportRequestId` - The id of the transport request to release.
|
||||
* `applicationId` - The id of the application.
|
||||
* `filePath` - The path of the file to upload.
|
||||
@ -44,6 +44,6 @@ None.
|
||||
|
||||
## Example
|
||||
```groovy
|
||||
transportRequestUploadFile script:this, changeId: '001', transportRequestId: '001', applicationId: '001', filePath: '/path'
|
||||
transportRequestUploadFile script:this, changeDocumentId: '001', transportRequestId: '001', applicationId: '001', filePath: '/path'
|
||||
```
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class TransportRequestCreateTest extends BasePiperTest {
|
||||
public void changeIdNotProvidedTest() {
|
||||
|
||||
thrown.expect(AbortException)
|
||||
thrown.expectMessage("Change id not provided (parameter: 'changeId').")
|
||||
thrown.expectMessage("Change document id not provided (parameter: 'changeDocumentId').")
|
||||
|
||||
jsr.step.call(script: nullScript, developmentSystemId: '001')
|
||||
}
|
||||
@ -69,7 +69,7 @@ public class TransportRequestCreateTest extends BasePiperTest {
|
||||
thrown.expect(AbortException)
|
||||
thrown.expectMessage("Development system id not provided (parameter: 'developmentSystemId').")
|
||||
|
||||
jsr.step.call(script: nullScript, changeId: '001')
|
||||
jsr.step.call(script: nullScript, changeDocumentId: '001')
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -80,7 +80,7 @@ public class TransportRequestCreateTest extends BasePiperTest {
|
||||
thrown.expect(AbortException)
|
||||
thrown.expectMessage("Cannot create a transport request for change id '001'. Exception message.")
|
||||
|
||||
jsr.step.call(script: nullScript, changeId: '001', developmentSystemId: '001')
|
||||
jsr.step.call(script: nullScript, changeDocumentId: '001', developmentSystemId: '001')
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -88,7 +88,7 @@ public class TransportRequestCreateTest extends BasePiperTest {
|
||||
|
||||
helper.registerAllowedMethod('sh', [Map], { Map m -> return '001' })
|
||||
|
||||
jsr.step.call(script: nullScript, changeId: '001', developmentSystemId: '001')
|
||||
jsr.step.call(script: nullScript, changeDocumentId: '001', developmentSystemId: '001')
|
||||
|
||||
assert jlr.log.contains("[INFO] Creating transport request for change document '001' and development system '001'.")
|
||||
assert jlr.log.contains("[INFO] Transport Request '001' has been successfully created.")
|
||||
|
@ -58,7 +58,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
|
||||
public void changeIdNotProvidedTest() {
|
||||
|
||||
thrown.expect(AbortException)
|
||||
thrown.expectMessage("Change id not provided (parameter: 'changeId').")
|
||||
thrown.expectMessage("Change document id not provided (parameter: 'changeDocumentId').")
|
||||
|
||||
jsr.step.call(script: nullScript, transportRequestId: '001')
|
||||
}
|
||||
@ -69,7 +69,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
|
||||
thrown.expect(AbortException)
|
||||
thrown.expectMessage("Transport Request id not provided (parameter: 'transportRequestId').")
|
||||
|
||||
jsr.step.call(script: nullScript, changeId: '001')
|
||||
jsr.step.call(script: nullScript, changeDocumentId: '001')
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -80,7 +80,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
|
||||
thrown.expect(AbortException)
|
||||
thrown.expectMessage("Cannot release Transport Request '001'. Return code from cmclient: 1.")
|
||||
|
||||
jsr.step.call(script: nullScript, changeId: '001', transportRequestId: '001')
|
||||
jsr.step.call(script: nullScript, changeDocumentId: '001', transportRequestId: '001')
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -88,7 +88,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
|
||||
|
||||
helper.registerAllowedMethod('sh', [Map], { Map m -> return 0 })
|
||||
|
||||
jsr.step.call(script: nullScript, changeId: '001', transportRequestId: '001')
|
||||
jsr.step.call(script: nullScript, changeDocumentId: '001', transportRequestId: '001')
|
||||
|
||||
assert jlr.log.contains("[INFO] Closing transport request '001' for change document '001'.")
|
||||
assert jlr.log.contains("[INFO] Transport Request '001' has been successfully closed.")
|
||||
|
@ -55,10 +55,10 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void changeIdNotProvidedTest() {
|
||||
public void changeDocumentIdNotProvidedTest() {
|
||||
|
||||
thrown.expect(AbortException)
|
||||
thrown.expectMessage("Change id not provided (parameter: 'changeId').")
|
||||
thrown.expectMessage("Change document id not provided (parameter: 'changeDocumentId').")
|
||||
|
||||
jsr.step.call(script: nullScript, transportRequestId: '001', applicationId: 'app', filePath: '/path')
|
||||
}
|
||||
@ -69,7 +69,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
|
||||
thrown.expect(AbortException)
|
||||
thrown.expectMessage("Transport Request id not provided (parameter: 'transportRequestId').")
|
||||
|
||||
jsr.step.call(script: nullScript, changeId: '001', applicationId: 'app', filePath: '/path')
|
||||
jsr.step.call(script: nullScript, changeDocumentId: '001', applicationId: 'app', filePath: '/path')
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -78,7 +78,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
|
||||
thrown.expect(AbortException)
|
||||
thrown.expectMessage("Application id not provided (parameter: 'applicationId').")
|
||||
|
||||
jsr.step.call(script: nullScript, changeId: '001', transportRequestId: '001', filePath: '/path')
|
||||
jsr.step.call(script: nullScript, changeDocumentId: '001', transportRequestId: '001', filePath: '/path')
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -87,7 +87,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
|
||||
thrown.expect(AbortException)
|
||||
thrown.expectMessage("File path not provided (parameter: 'filePath').")
|
||||
|
||||
jsr.step.call(script: nullScript, changeId: '001', transportRequestId: '001', applicationId: 'app')
|
||||
jsr.step.call(script: nullScript, changeDocumentId: '001', transportRequestId: '001', applicationId: 'app')
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -98,7 +98,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
|
||||
thrown.expect(AbortException)
|
||||
thrown.expectMessage("Cannot upload file '/path' for change document '001' with transport request '001'. Return code from cmclient: 1.")
|
||||
|
||||
jsr.step.call(script: nullScript, changeId: '001', transportRequestId: '001', applicationId: 'app', filePath: '/path')
|
||||
jsr.step.call(script: nullScript, changeDocumentId: '001', transportRequestId: '001', applicationId: 'app', filePath: '/path')
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -106,7 +106,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
|
||||
|
||||
helper.registerAllowedMethod('sh', [Map], { Map m -> return 0 })
|
||||
|
||||
jsr.step.call(script: nullScript, changeId: '001', transportRequestId: '001', applicationId: 'app', filePath: '/path')
|
||||
jsr.step.call(script: nullScript, changeDocumentId: '001', transportRequestId: '001', applicationId: 'app', filePath: '/path')
|
||||
|
||||
assert jlr.log.contains("[INFO] Uploading file '/path' to transport request '001' of change document '001'.")
|
||||
assert jlr.log.contains("[INFO] File '/path' has been successfully uploaded to transport request '001' of change document '001'.")
|
||||
|
@ -11,7 +11,7 @@ import hudson.AbortException
|
||||
@Field def STEP_NAME = 'transportRequestCreate'
|
||||
|
||||
@Field Set parameterKeys = [
|
||||
'changeId',
|
||||
'changeDocumentId',
|
||||
'developmentSystemId',
|
||||
'cmCredentialsId',
|
||||
'cmEndpoint'
|
||||
@ -34,8 +34,8 @@ def call(parameters = [:]) {
|
||||
parameters, parameterKeys,
|
||||
stepConfigurationKeys)
|
||||
|
||||
def changeId = configuration.changeId
|
||||
if(!changeId) throw new AbortException('Change id not provided (parameter: \'changeId\').')
|
||||
def changeDocumentId = configuration.changeDocumentId
|
||||
if(!changeDocumentId) throw new AbortException('Change document id not provided (parameter: \'changeDocumentId\').')
|
||||
|
||||
def developmentSystemId = configuration.developmentSystemId
|
||||
if(!developmentSystemId) throw new AbortException('Development system id not provided (parameter: \'developmentSystemId\').')
|
||||
@ -48,7 +48,7 @@ def call(parameters = [:]) {
|
||||
|
||||
def transportRequestId
|
||||
|
||||
echo "[INFO] Creating transport request for change document '$changeId' and development system '$developmentSystemId'."
|
||||
echo "[INFO] Creating transport request for change document '$changeDocumentId' and development system '$developmentSystemId'."
|
||||
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: cmCredentialsId,
|
||||
@ -56,7 +56,7 @@ def call(parameters = [:]) {
|
||||
usernameVariable: 'username')]) {
|
||||
|
||||
try {
|
||||
transportRequestId = cm.createTransportRequest(changeId, developmentSystemId, cmEndpoint, username, password)
|
||||
transportRequestId = cm.createTransportRequest(changeDocumentId, developmentSystemId, cmEndpoint, username, password)
|
||||
} catch(ChangeManagementException ex) {
|
||||
throw new AbortException(ex.getMessage())
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import hudson.AbortException
|
||||
@Field def STEP_NAME = 'transportRequestRelease'
|
||||
|
||||
@Field Set parameterKeys = [
|
||||
'changeId',
|
||||
'changeDocumentId',
|
||||
'transportRequestId',
|
||||
'cmCredentialsId',
|
||||
'cmEndpoint'
|
||||
@ -34,8 +34,8 @@ def call(parameters = [:]) {
|
||||
parameters, parameterKeys,
|
||||
stepConfigurationKeys)
|
||||
|
||||
def changeId = configuration.changeId
|
||||
if(!changeId) throw new AbortException("Change id not provided (parameter: 'changeId').")
|
||||
def changeDocumentId = configuration.changeDocumentId
|
||||
if(!changeDocumentId) throw new AbortException("Change document id not provided (parameter: 'changeDocumentId').")
|
||||
|
||||
def transportRequestId = configuration.transportRequestId
|
||||
if(!transportRequestId) throw new AbortException("Transport Request id not provided (parameter: 'transportRequestId').")
|
||||
@ -46,7 +46,7 @@ def call(parameters = [:]) {
|
||||
def cmEndpoint = configuration.cmEndpoint
|
||||
if(!cmEndpoint) throw new AbortException("Solution Manager endpoint not provided (parameter: 'cmEndpoint').")
|
||||
|
||||
echo "[INFO] Closing transport request '$transportRequestId' for change document '$changeId'."
|
||||
echo "[INFO] Closing transport request '$transportRequestId' for change document '$changeDocumentId'."
|
||||
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: cmCredentialsId,
|
||||
@ -54,7 +54,7 @@ def call(parameters = [:]) {
|
||||
usernameVariable: 'username')]) {
|
||||
|
||||
try {
|
||||
cm.releaseTransportRequest(changeId, transportRequestId, cmEndpoint, username, password)
|
||||
cm.releaseTransportRequest(changeDocumentId, transportRequestId, cmEndpoint, username, password)
|
||||
} catch(ChangeManagementException ex) {
|
||||
throw new AbortException(ex.getMessage())
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import hudson.AbortException
|
||||
@Field def STEP_NAME = 'transportRequestUploadFile'
|
||||
|
||||
@Field Set parameterKeys = [
|
||||
'changeId',
|
||||
'changeDocumentId',
|
||||
'transportRequestId',
|
||||
'applicationId',
|
||||
'filePath',
|
||||
@ -36,8 +36,8 @@ def call(parameters = [:]) {
|
||||
parameters, parameterKeys,
|
||||
generalConfigurationKeys)
|
||||
|
||||
def changeId = configuration.changeId
|
||||
if(!changeId) throw new AbortException("Change id not provided (parameter: 'changeId').")
|
||||
def changeDocumentId = configuration.changeDocumentId
|
||||
if(!changeDocumentId) throw new AbortException("Change document id not provided (parameter: 'changeDocumentId').")
|
||||
|
||||
def transportRequestId = configuration.transportRequestId
|
||||
if(!transportRequestId) throw new AbortException("Transport Request id not provided (parameter: 'transportRequestId').")
|
||||
@ -54,7 +54,7 @@ def call(parameters = [:]) {
|
||||
def cmEndpoint = configuration.cmEndpoint
|
||||
if(!cmEndpoint) throw new AbortException("Solution Manager endpoint not provided (parameter: 'cmEndpoint').")
|
||||
|
||||
echo "[INFO] Uploading file '$filePath' to transport request '$transportRequestId' of change document '$changeId'."
|
||||
echo "[INFO] Uploading file '$filePath' to transport request '$transportRequestId' of change document '$changeDocumentId'."
|
||||
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: cmCredentialsId,
|
||||
@ -62,12 +62,12 @@ def call(parameters = [:]) {
|
||||
usernameVariable: 'username')]) {
|
||||
|
||||
try {
|
||||
cm.uploadFileToTransportRequest(changeId, transportRequestId, applicationId, filePath, cmEndpoint, username, password)
|
||||
cm.uploadFileToTransportRequest(changeDocumentId, transportRequestId, applicationId, filePath, cmEndpoint, username, password)
|
||||
} catch(ChangeManagementException ex) {
|
||||
throw new AbortException(ex.getMessage())
|
||||
}
|
||||
}
|
||||
|
||||
echo "[INFO] File '$filePath' has been successfully uploaded to transport request '$transportRequestId' of change document '$changeId'."
|
||||
echo "[INFO] File '$filePath' has been successfully uploaded to transport request '$transportRequestId' of change document '$changeDocumentId'."
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user