You've already learned how to manage some important stages of a modeling project’s lifecycle.
Create a project and define key settings.
Import and export modeling content.
Deploy selected objects or an entire HDB module.
Let’s now discuss the deployment of an application. We'll consider the deployment of a simple application made up of one or several HDB modules. Remember, applications often include other types of modules such as HTML, NodeJS, Java, and so on. These full-stack applications are known as multitarget applications (MTA). The same deployment principles described here apply.
Application Deployment Versus Database Objects Deployment
Let’s first make a clear difference between deploying database objects and deploying an entire application.
When you work on a project, you deploy modeling content to the HDI container on a regular basis, in order to test it, check dependencies, and so on. This is something you trigger from SAP Business Application Studio. To do that, you need to have a modeler role for the space in which the HDI container bound to your HDB module sits.
When you deploy an HDB module (or some of its individual source files), if the deployment is successful, the corresponding runtime objects are generated in the HDI container, running in the corresponding development space.
On the other hand, deploying an application is something you do in a target space at a specific point in time, for example, to test the application in a QA environment or set the application to production. Deploying an application can be done outside of SAP Business Application Studio. The user who deploys the application doesn't need to have a developer role in the target space.
To deploy your modeling content to a target environment, such as QA or PROD, you must do the following:
- Build the HDB modules.
- Build the entire project in order to generate an MTA archive file (
- Export the MTA archive.
- Deploy the MTA archive to the target landscape.
Between steps 3 and 4, you must, of course, make the MTA archive file available to the target landscape, for example, by copying the file to a specific folder or using a dedicated transport tool.
Source Files for Deployment
The key source file for application deployment is generated by a build operation at the project level in SAP Business Application Studio. This creates a .mtar (MTA archive) file, which is technically a .rar compressed file. This file is named
<Application ID>_<version>.mtar and can be found in your workspace, in the folder mta_archives. This archive contains the file mtad.yaml, which is an equivalent of the mta.yaml file but specific to application deployment.
Another important (though, optional) file used for deployment is the .mtaext file. This is an extension file in which the space administrator who deploys the application can specify additions or modifications to the mtad.yaml file in order to pass the relevant parameters for the target environment during deployment. Typical examples of what you can specify in the extension file include the following:
The name you want to give to the HDI container schema
The actual name of a user-provided service in the target environment
The actual name of another HDI container service in the target environment
To generate the .mtar file you open a Terminal session in SAP Business Application Studio and type the command mbt build. Make sure you navigate to the root folder of the project you want to build before executing this command. From the root project folder, use the command cd to change directories, for example, cd my_app.
The name of the HDI containers created during the deployment of your application is also an important parameter. This is the name of the HDI container resource declared in the mta.yaml file (by default, when you create the HDB module,