mtaBuild¶
Performs an mta build
Description¶
Executes the SAP Multitarget Application Archive Builder to create an mtar archive of the application.
Usage¶
We recommend to define values of step parameters via config.yml file. In this case, calling the step is reduced to one simple line.
Calling the step can be done either via the Jenkins library step or on the command line.
Jenkins pipelines¶
mtaBuild script: this
Command line¶
piper mtaBuild
Outputs¶
Output type | Details |
---|---|
commonPipelineEnvironment |
|
Prerequisites¶
While using a custom docker file, ensure that the following tools are installed:
- SAP MTA Archive Builder 1.0.6 or compatible version - can be downloaded from SAP Development Tools.
- Java 8 or compatible version - necessary to run the MTA Archive Builder itself and to build Java modules.
- NodeJS installed - the MTA Builder uses
npm
to download node module dependencies such asgrunt
.
Parameters¶
Overview¶
Name | Mandatory | Additional information |
---|---|---|
script | yes | |
applicationName | no | |
buildTarget | no | |
containerCommand | no | |
containerShell | no | |
defaultNpmRegistry | no | |
dockerEnvVars | no | |
dockerImage | no | |
dockerName | no | |
dockerOptions | no | |
dockerPullImage | no | |
dockerVolumeBind | no | |
dockerWorkspace | no | |
extensions | no | |
globalSettingsFile | no | |
installArtifacts | no | |
m2Path | no | |
mtaBuildTool | no | |
mtaJarLocation | no | |
mtarName | no | |
platform | no | |
projectSettingsFile | no | |
sapNpmRegistry | no | |
verbose | no | activates debug output |
Details¶
applicationName¶
The name of the application which is being built. If the parameter has been provided and no mta.yaml
exists, the mta.yaml
will be automatically generated using this parameter and the information (name
and version
) from 'package.json` before the actual build starts.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_applicationName (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
buildTarget¶
mtaBuildTool 'classic' only: The target platform to which the mtar can be deployed. Valid values: 'CF', 'NEO', 'XSA'.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | NEO |
Possible values | - CF - NEO - XSA |
Secret | no |
Configuration scope |
|
Resource references | none |
containerCommand¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Allows to specify start command for container created with dockerImage parameter to overwrite Piper default (/usr/bin/tail -f /dev/null).
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
containerShell¶
Jenkins-specific: Used for proper environment setup.
Allows to specify the shell to be executed for container with containerName.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
defaultNpmRegistry¶
Url to the npm registry that should be used for installing npm dependencies.
Scope | Details |
---|---|
Aliases | npm/defaultNpmRegistry |
Type | string |
Mandatory | no |
Default | $PIPER_defaultNpmRegistry (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerEnvVars¶
Jenkins-specific: Used for proper environment setup.
Environment variables to set in the container, e.g. [http_proxy: "proxy:8080"].
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerImage¶
Jenkins-specific: Used for proper environment setup.
Name of the docker image that should be used. If empty, Docker is not used and the command is executed directly on the Jenkins system.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | mtaBuildTool=cloudMbt : devxci/mbtci:1.0.14.1 mtaBuildTool= classic : ppiper/mta-archive-builder:v1 |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerName¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Name of the container launching dockerImage. SideCar only: Name of the container in local network.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerOptions¶
Jenkins-specific: Used for proper environment setup.
Docker options to be set when starting the container.
Scope | Details |
---|---|
Aliases | - |
Type | []string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerPullImage¶
Jenkins-specific: Used for proper environment setup.
Set this to 'false' to bypass a docker image pull. Usefull during development process. Allows testing of images which are available in the local registry only.
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | mtaBuildTool=cloudMbt : true mtaBuildTool= classic : true |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerVolumeBind¶
Jenkins-specific: Used for proper environment setup.
Volumes that should be mounted into the docker container.
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerWorkspace¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Specifies a dedicated user home directory for the container which will be passed as value for environment variable HOME
.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
extensions¶
The path to the extension descriptor file.
Scope | Details |
---|---|
Aliases | extension |
Type | string |
Mandatory | no |
Default | $PIPER_extensions (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
globalSettingsFile¶
Path or url to the mvn settings file that should be used as global settings file
Scope | Details |
---|---|
Aliases | maven/globalSettingsFile |
Type | string |
Mandatory | no |
Default | $PIPER_globalSettingsFile (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
installArtifacts¶
If enabled, for npm packages this step will install all depedencies including dev dependencies. For maven it will install all artifacts to the local maven repository.
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
m2Path¶
Path to the location of the local repository that should be used.
Scope | Details |
---|---|
Aliases | maven/m2Path |
Type | string |
Mandatory | no |
Default | $PIPER_m2Path (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
mtaBuildTool¶
Tool to use when building the MTA. Valid values: 'classic', 'cloudMbt'.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | cloudMbt |
Possible values | - cloudMbt - classic |
Secret | no |
Configuration scope |
|
Resource references | none |
mtaJarLocation¶
mtaBuildTool 'classic' only: The location of the SAP Multitarget Application Archive Builder jar file, including file name and extension. If you run on Docker, this must match the location of the jar file in the container as well.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | /opt/sap/mta/lib/mta.jar |
Secret | no |
Configuration scope |
|
Resource references | none |
mtarName¶
The name of the generated mtar file including its extension.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_mtarName (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
platform¶
mtaBuildTool 'cloudMbt' only: The target platform to which the mtar can be deployed.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | CF |
Possible values | - CF - NEO - XSA |
Secret | no |
Configuration scope |
|
Resource references | none |
projectSettingsFile¶
Path or url to the mvn settings file that should be used as project settings file.
Scope | Details |
---|---|
Aliases | maven/projectSettingsFile |
Type | string |
Mandatory | no |
Default | $PIPER_projectSettingsFile (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
sapNpmRegistry¶
Url to the sap npm registry that should be used for installing npm dependencies prefixed with @sap.
Scope | Details |
---|---|
Aliases | npm/sapNpmRegistry |
Type | string |
Mandatory | no |
Default | https://npm.sap.com |
Secret | no |
Configuration scope |
|
Resource references | none |
script¶
Jenkins-specific: Used for proper environment setup.
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
for retrieving, e.g. configuration parameters.
Scope | Details |
---|---|
Aliases | - |
Type | Jenkins Script |
Mandatory | yes |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
verbose¶
verbose output
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
¶
Side effects¶
- The file name of the resulting archive is written to the
commonPipelineEnvironment
with variable namemtarFileName
.
Exceptions¶
AbortException
:- If there is an invalid
buildTarget
. - If there is no key
ID
inside themta.yaml
file.
Example¶
dir('/path/to/FioriApp'){ mtaBuild script:this, buildTarget: 'NEO' } def mtarFilePath = commonPipelineEnvironment.getMtarFilePath()