Run cds build to compile the CDS model, use mbt to package the MTA archive, and deploy with cf deploy. Understand what each step produces.
Deploying a CAP app to BTP is a three-step process: compile → package → deploy.
npm install -g mbt
mbt --version # 1.x.x
cds build compiles your .cds model into deployable artifacts:
cds build --production
This creates a gen/ folder:
gen/
├── srv/ ← compiled Node.js service (ready for CF push)
│ ├── package.json
│ └── ...
└── db/ ← compiled HANA artifacts (hdbcds, hdbtable)
└── src/
Always run cds build before packaging — the gen/ folder is what gets deployed, not your source.
mbt build
This reads mta.yaml, runs any build commands, and produces:
mta_archives/
└── my-cap-app_1.0.0.mtar ← the deployable archive
The .mtar is a ZIP file containing all modules and their manifests.
# Install the CF MTA plugin (once)
cf install-plugin multiapps
# Deploy
cf deploy mta_archives/my-cap-app_1.0.0.mtar
The deployer:
1. Creates service instances listed in resources (if they don't exist)
2. Uploads each module
3. Binds services to apps
4. Starts apps in dependency order
cf deploy mta_archives/my-cap-app_1.0.0.mtar --retries 0 -f
Flags:
- --retries 0 — fail fast instead of retrying
- -f — skip confirmation prompt (for CI/CD)
cf mtas # list all MTAs in current space
cf mta my-cap-app # details of one MTA
Save as deploy.sh:
#!/bin/bash
set -e
echo "▶ Building CDS model..."
cds build --production
echo "▶ Packaging MTA..."
mbt build
echo "▶ Deploying to BTP..."
cf deploy mta_archives/*.mtar -f
echo "✅ Done!"
chmod +x deploy.sh
./deploy.sh
Sign in for progress tracking & Q&A →