Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Latest commit

 

History

History
74 lines (44 loc) · 3.23 KB

File metadata and controls

74 lines (44 loc) · 3.23 KB

Deploy the CAP Application Using SAP Business Application Studio

In this section, you will be deploying the CAP application to SAP BTP, Cloud Foundry environment.

Open the CAP application using SAP Business Application Studio.

Log In to Cloud Foundry and Set Targets (Only required if not logged in yet)

  1. Choose Cloud Foundry from the Activity bar.
  2. Enter the Cloud Foundry Sign In details.
  3. Choose the Cloud Foundry Organization and Cloud Foundry Space.
  4. Choose Apply.

See Cloud Foundry Tools.

Preparation

Projects using CAP need to manage dependencies to the respective tools and libraries in their package.json.

  1. Open TerminalNew Terminal.

  2. If you are not in the imported project folder already, go to it by entering cd DWCMission.

  3. Enter npx npm-check-updates -u.

It provides a list of outdated packages along with the version to which they would be updated, updates the dependencies in your package.json file to the most recent versions, and makes the necessary changes to the package.json file.

  1. Enter npm i @sap/cds-dk

It updates the cds version.

  1. Enter npm install.

The package-lock.json file in your project root freezes all dependencies and is deployed with your application.

See Lock Dependencies Before Deploying.

Build and Deploy the CAP Application

  1. Right click the mta.yaml file and choose Build MTA Project.

  1. Make sure the build is completed and the MTAR file is created under mta_archives.

  1. Right click the MTAR file under mta_archives and choose Deploy MTA Archive.

Alernatively, you could build and deploy using the following commands too:

  1. Open TerminalNew Terminal.

  2. If you are not in the imported project folder already, go to it by entering cd DWCMission.

  3. Enter mbt build -t gen --mtar mta.tar.

  4. Enter cf deploy gen/mta.tar --delete-services.

  5. Make sure the deployement is successful and availble in the SAP BTP cockpit.

  1. In the SAP BTP cockpit, go to your subaccount and then to your space, and find the OData endpoint.

  1. Choose the application route to view the service endpoint.

  1. Make sure to use the user ID (field.technician@tester.sap.com) and password (initial) to access the endpoint.

See Building and Deploying Multitarget Applications

SAP BTP Destination Details

The SAP BTP application route above serves as the URL for defining SAP BTP Destinations, enabling the SAP Build Apps application to access the SAP Datasphere data through it.

Summary

You have successfully deployed your CAP application! As a result, you can now access the OData service exposed by this application.