Skip to Content
Technical Articles

SAP Cloud Application Programming Model – Demo5

Hello Community

In this page, Let’s learn how to deploy CAP apps to Cloud Foundry environment of SAP Cloud Platform.

Links to my prior blogs:

https://blogs.sap.com/2020/05/01/sap-cloud-application-programming-model-demo1/

https://blogs.sap.com/2020/05/03/sap-cloud-application-programming-model-demo2/

https://blogs.sap.com/2020/05/10/sap-cloud-application-programming-model-demo3/

https://blogs.sap.com/2020/05/16/sap-cloud-application-programming-model-demo4/

I used my earlier blog: https://blogs.sap.com/2020/05/03/sap-cloud-application-programming-model-demo2/ to structure the project.

Two approaches are available in deploying the application to Cloud Foundry Environment.

  1. Deployment using cf push
  2. Deployment using multi target application(MTA) concept

cf push deployment process:

Execute the below commands from terminal in project directory.

cds add hana: configures the application to SAP HANA db.

cds build/all: Build the application: adds few folders and files to our project.

cf create-service hanatrial hdi-shared studentreport-db-hdi-container: Create service

cf push -f gen/db/: Push the application

add https:// to above routes and run in new window.

Deployment using multi target application(MTA) concept:  builds convenient features compared to cf push deployment approach.

Follow the below steps for second deployment process:

cds add mta: Generate MTA descriptor file.

Above command adds this file to our project.

mbt build: Builds the application archive

cf deploy mta_archives/studentreport_1.0.0.mtar

 

copy the application name from the terminal, add https:// and run the URL in new window. Finally the output looks the same way as the first approach with minimal steps.

Please Suggest/ Comment..

Thank you!! 🙂

#EnhanceLearning

BR//Dhanasupriya Sidagam

8 Comments
You must be Logged on to comment or reply to a post.
  • Hi Dhanasupriya,

     

    When trying to follow these steps.. am getting the below error, could you please help.

    Error staging application "nnnnnnn-srv": BuildpackCompileFailed - App staging failed in the buildpack compile phase
    Download the application logs via the dmol command and check them for more information.
    A step of the process has failed. Retrying it may solve the issue.
    Process failed.

  • Hi Dhanasupriya,

     

    Is it manadatory to create Service like below from command

    cf create-service hanatrial hdi-shared studentreport-db-hdi-container: Create service

     

    Here what i understood is you are creating  a db Table with name studentreport-db-hdi-container and Pushing the app.

    Here studentreport-db-hdi-container is similar to your project name. Now i want my db name different from Project name and i want to push. Is this Possible.

     

    Project Name : Demo_books

    DB Name : books_Demo-db

    cf create-service hanatrial hdi-shared books_Demo-db-hdi-container: Create service (I created this DB for some project and now i want to use this for Demo_Books Project also)

     

    Regards,

    Shekar.