Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 1 of 5

MTA packaging: one archive, one lifecycle

11 min

Listen to this lesson

0:00 / 9:54

Contoso Motor Co.'s fleet order status app has grown up. What started as a single Node.js service now has a user interface, a service layer built with the SAP Cloud Application Programming Model, a database deployer for SAP HANA Cloud, and bindings to the destination, authorization and HTML5 repository services. Each piece could be deployed by hand, but then nobody could say for sure which version of which piece is running in which subaccount. The answer on Cloud Foundry is the multitarget application (MTA): one application made of several parts that share one lifecycle and are deployed together.

Global elementsID and version that identify the MTA, for example com.contoso.fleetorderstatus 1.4.0, plus optional description and provider
ModulesThe deployable parts: the CAP service, the UI content, the database deployer. Each has a type that decides how it is built and deployed
ResourcesThings the modules need but do not contain: service instances such as destination, authorization and trust, SAP HANA Cloud
Dependenciesrequires and provides sections that connect modules to resources and to each other
Parameters and propertiesParameters steer deployment (memory, instances, service plan); properties become environment variables at runtime
What an MTA model describes, from SAP's MTA structure documentation.
The Sign-Off Table · thesignofftable.com/academy/sap-btp-302

The three descriptors

SAP's documentation distinguishes three YAML files, and mixing them up is the most common source of confusion. The development descriptor, mta.yaml, lives in the source repository and lists modules, resources, properties and dependencies. Tools such as SAP Business Application Studio generate it, but developers usually edit it. The deployment descriptor, mtad.yaml, is what the SAP Cloud Deployment service actually reads; the Cloud MTA Build Tool generates it from the development descriptor during the build. The extension descriptor, a file ending in .mtaext, sits outside the archive and adds or overrides parameters and properties for one target, such as production. Lesson 4 is about extension descriptors.

Developers edit mta.yaml, the build generates mtad.yaml inside the archive, and a per-target .mtaext stays outside it and adjusts the deployment.
The Sign-Off Table · thesignofftable.com/academy/sap-btp-302
mta.yamlmtad.yaml.mtaext
NameDevelopment descriptorDeployment descriptorExtension descriptor
Lives inSource repositoryInside the MTA archiveOutside the archive, per target
Written byDevelopers, with tool supportGenerated by the buildPlatform or release team
PurposeDescribe modules, resources and dependenciesTell the deploy service what to createAdjust parameters and properties for one environment
Changes per stage?NoNo: built onceYes: one per target
The three MTA descriptors compared.
The Sign-Off Table · thesignofftable.com/academy/sap-btp-302

The archive: what actually moves

The build produces an MTA archive (.mtar): a package that follows the JAR file format and contains the deployment descriptor, the built module binaries and configuration files. That archive is the unit of deployment and the unit of transport. SAP Cloud Transport Management accepts .mtar files for the MTA content type, and the SAP Cloud Deployment service deploys them, for example with the Cloud Foundry CLI command cf deploy. When Priya asks "what exactly are we testing?", the honest answer is a file name and a version: fleet-order-status_1.4.0.mtar.

The deploy service validates the descriptor against the MTA specification version before it changes anything. If validation fails, the deployment stops at the start, which is far better than a half-deployed app. It then creates or updates service instances, deploys modules as Cloud Foundry applications or content, binds them, and starts them, following the dependencies in the descriptor.

The deploy service validates the descriptor before it changes anything, so a bad archive stops at the start instead of leaving a half-deployed app.
The Sign-Off Table · thesignofftable.com/academy/sap-btp-302

Build once, promote many

The single most important rule in this course follows from the archive: build once, then promote the same archive through test and production. If the pipeline rebuilds from source for each stage, the production archive may pull a newer library, a different build tool version or an uncommitted change, and the test results no longer describe what reaches production. Differences between stages belong in configuration (lesson 4), never in a rebuild.

  1. CommitA developer pushes a change to the main branch of the fleet order status repository
  2. BuildThe pipeline runs the Cloud MTA Build Tool: mta.yaml in, fleet-order-status_1.4.0.mtar out
  3. Test in developmentThe same archive is deployed to the development space and tested
  4. Promote to testThe same archive enters the CMC_TEST import queue and is imported into cmc-ext-test
  5. Promote to productionThe same archive is imported into cmc-ext-prod after sign-off
Build once, promote many: one archive travels the whole path.
The Sign-Off Table · thesignofftable.com/academy/sap-btp-302
Question from the test leadWhere the answer lives
Which modules does this release contain?modules section of mta.yaml, and the archive contents
Which services does it need?resources section, with service and service-plan parameters
What runs in production right now?The MTA ID and version shown for deployed MTAs in the target space
Was the tested archive the one imported?The transport request in SAP Cloud Transport Management, which names the archive

Turning the MTA model into test evidence.

What would you do?

The fleet order status app passed all tests in cmc-ext-test with archive 1.4.0. Before the production import, a developer offers to "rebuild it quickly from main with the latest fixes, same version number". What should Priya say?

Key points
  • An MTA is one application made of modules and resources that share a lifecycle.
  • mta.yaml is the development descriptor; mtad.yaml is the deployment descriptor; .mtaext files extend it per target.
  • The .mtar archive is the unit of deployment and transport; the deploy service validates it before changing anything.
  • Build once and promote the same archive; put stage differences in configuration, not in rebuilds.
  • Version every release candidate; versions tie together deployments, transports and test evidence.

Check your understanding · not graded

Lesson check

  1. 1. Which file do developers normally edit to describe modules, resources and dependencies?

  2. 2. What is an MTA resource?

  3. 3. Why should the same archive be promoted through test and production?

  4. 4. What happens if the deployment descriptor fails validation?