mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
Configure default mta build image to ppiper/mta-archive-builder (#515)
This commit is contained in:
parent
58c8063e6d
commit
d2b6be4e25
@ -8,29 +8,21 @@ Before doing this, validates that SAP Multitarget Application Archive Builder ex
|
||||
|
||||
Note that a version is formed by `major.minor.patch`, and a version is compatible to another version if the minor and patch versions are higher, but the major version is not, e.g. if 3.39.10 is the expected version, 3.39.11 and 3.40.1 would be compatible versions, but 4.0.1 would not be a compatible version.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* A docker image meeting the following requirements
|
||||
* **SAP MTA Archive Builder 1.0.6 or compatible version** - can be downloaded from [SAP Development Tools](https://tools.hana.ondemand.com/#cloud).
|
||||
* **Java 8 or compatible version** - necessary to run the `mta.jar` file.
|
||||
* **NodeJS installed** - the MTA Builder uses `npm` to download node module dependencies such as `grunt`.
|
||||
|
||||
## Parameters
|
||||
|
||||
| parameter | mandatory | default | possible values |
|
||||
| -----------------|-----------|--------------------------------------------------------|--------------------|
|
||||
| `script` | yes | | |
|
||||
| `dockerImage` | yes | | |
|
||||
| `dockerImage` | no | `ppiper/mta-archive-builder` | |
|
||||
| `dockerOptions` | no | '' | |
|
||||
| `buildTarget` | yes | `'NEO'` | 'CF', 'NEO', 'XSA' |
|
||||
| `extension` | no | | |
|
||||
| `mtaJarLocation` | no | `'mta.jar'` | |
|
||||
| `extension` | no | | |
|
||||
| `mtaJarLocation` | no | `'/opt/sap/mta/lib/mta.jar'` | |
|
||||
| `applicationName`| no | | |
|
||||
|
||||
* `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.
|
||||
* `dockerImage` - The Docker image to execute the MTA build.
|
||||
A custom built image needs to include Multi-target Application Archive Builder.
|
||||
Refer to [SAP Help Portal](https://help.sap.com/viewer/58746c584026430a890170ac4d87d03b/Cloud/en-US/ba7dd5a47b7a4858a652d15f9673c28d.html) for information on how to set it up.
|
||||
Note that you can provide your own image if required, but for most cases, the default should be fine.
|
||||
* `dockerOptions` Docker options to be set when starting the container. It can be a list or a string.
|
||||
* `buildTarget` - The target platform to which the mtar can be deployed.
|
||||
* `extension` - The path to the extension descriptor file.
|
||||
|
@ -232,7 +232,8 @@ steps:
|
||||
logSuccessfulMavenTransfers: false
|
||||
mtaBuild:
|
||||
buildTarget: 'NEO'
|
||||
mtaJarLocation: 'mta.jar'
|
||||
mtaJarLocation: '/opt/sap/mta/lib/mta.jar'
|
||||
dockerImage: 'ppiper/mta-archive-builder'
|
||||
neoDeploy:
|
||||
dockerImage: 's4sdk/docker-neo-cli'
|
||||
deployMode: 'mta'
|
||||
|
@ -73,7 +73,7 @@ public class MtaBuildTest extends BasePiperTest {
|
||||
|
||||
|
||||
@Test
|
||||
void mtarFilePathFromCommonPipelineEnviromentTest() {
|
||||
void mtarFilePathFromCommonPipelineEnvironmentTest() {
|
||||
|
||||
stepRule.step.mtaBuild(script: nullScript,
|
||||
buildTarget: 'NEO')
|
||||
@ -163,9 +163,9 @@ public class MtaBuildTest extends BasePiperTest {
|
||||
stepRule.step.mtaBuild(script: nullScript,
|
||||
buildTarget: 'NEO')
|
||||
|
||||
assert shellRule.shell.find(){ c -> c.contains("-jar mta.jar --mtar")}
|
||||
assert loggingRule.log.contains("SAP Multitarget Application Archive Builder file 'mta.jar' retrieved from configuration.")
|
||||
assert loggingRule.log.contains("Using SAP Multitarget Application Archive Builder 'mta.jar'.")
|
||||
assert shellRule.shell.find(){ c -> c.contains("-jar /opt/sap/mta/lib/mta.jar --mtar")}
|
||||
assert loggingRule.log.contains("SAP Multitarget Application Archive Builder file '/opt/sap/mta/lib/mta.jar' retrieved from configuration.")
|
||||
assert loggingRule.log.contains("Using SAP Multitarget Application Archive Builder '/opt/sap/mta/lib/mta.jar'.")
|
||||
}
|
||||
|
||||
|
||||
@ -174,7 +174,7 @@ public class MtaBuildTest extends BasePiperTest {
|
||||
|
||||
stepRule.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
|
||||
|
||||
assert shellRule.shell.find { c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
|
||||
assert shellRule.shell.find { c -> c.contains('java -jar /opt/sap/mta/lib/mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
|
||||
}
|
||||
|
||||
|
||||
@ -185,7 +185,7 @@ public class MtaBuildTest extends BasePiperTest {
|
||||
|
||||
stepRule.step.mtaBuild(script: nullScript)
|
||||
|
||||
assert shellRule.shell.find(){ c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
|
||||
assert shellRule.shell.find(){ c -> c.contains('java -jar /opt/sap/mta/lib/mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -211,7 +211,7 @@ public class MtaBuildTest extends BasePiperTest {
|
||||
|
||||
stepRule.step.mtaBuild(script: nullScript)
|
||||
|
||||
assert shellRule.shell.find { c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
|
||||
assert shellRule.shell.find { c -> c.contains('java -jar /opt/sap/mta/lib/mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
|
||||
}
|
||||
|
||||
|
||||
@ -220,7 +220,7 @@ public class MtaBuildTest extends BasePiperTest {
|
||||
|
||||
stepRule.step.mtaBuild(script: nullScript, buildTarget: 'NEO', extension: 'param_extension')
|
||||
|
||||
assert shellRule.shell.find { c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO --extension=param_extension build')}
|
||||
assert shellRule.shell.find { c -> c.contains('java -jar /opt/sap/mta/lib/mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO --extension=param_extension build')}
|
||||
}
|
||||
|
||||
|
||||
@ -231,7 +231,7 @@ public class MtaBuildTest extends BasePiperTest {
|
||||
|
||||
stepRule.step.mtaBuild(script: nullScript)
|
||||
|
||||
assert shellRule.shell.find(){ c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO --extension=config_extension build')}
|
||||
assert shellRule.shell.find(){ c -> c.contains('java -jar /opt/sap/mta/lib/mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO --extension=config_extension build')}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user