Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

Latest commit

 

History

History
78 lines (45 loc) · 2.72 KB

File metadata and controls

78 lines (45 loc) · 2.72 KB

Exercise 05: Deploy the application to SAP Cloud Platform Cloud Foundry environment

Estimated time

20 minutes

Objective

In this exercise, we will deploy the application to SAP Cloud Platform Cloud Foundry environment. The multiple components of the app is visualized and monitored from SAP Cloud Platform Cockpit.

Exercise description

  1. Inside the ui folder of the project, add the following lines of code to xs-app.json.
    {
      "source": "^/booking/(.*)$",
      "destination": "backend"
    }

xs-app.json now looks as shown below:

xs-app.json

  1. In the project root folder, right click on mta.yaml file and open it using the MTA editor as shown.

MTA Editor.json

  1. Choose ui module and scroll down to requires section, Click on the + button and pick the option srv_api(provider) as shown:

requires

Include the destinations value under Group. Add the following three properties as key value pairs by clicking the + button as shown:

name: backend
url: ~{url}
forwardAuthToken: true

properties

Now click on dest_cloud-sample-spaceflight-node and delete it using the delete button as shown below.

Destination delete

  1. Goto the Resources tab of the same file in the top. Choose cloud-sample-spaceflight-node-uaa and click on delete button as shown.

Delete UAA

Next choose dest_cloud-sample-spaceflight-node and click on delete button as shown.

Delete destination

Finally save the mta.yaml file.

  1. Right click at the project level and choose Build and again click on Build.

Build Project

This will generate a multi-target archive file as shown under a folder called mta_archives. This may take a couple of seconds.

MTAR generated

  1. Right click on the .mtar file -> choose Deploy -> click on Deploy to SAP Cloud Platform.

Deploy

  1. Enter the Cloud Foundry API Endpoint, Organization and Space as shown: (Space will differ for each user)

Deploy

This will take around 5 to 10 minutes. And then your application is deployed to cloud foundry environment of SAP Cloud Platform.

  1. Go to SAP Cloud Platform Cockpit and navigate into the right space to see your applications running.

Apps

Congratulations, you successfully built the space travel node application using the programming model of SAP Cloud Platform!