In this exercise you'll learn how easy it is to deploy your application directly from SAP Business Application Studio to the SAP BTP, Cloud Foundry runtime.
First of all, you need to create the space in your Cloud Foundry environment to host your newly created UI5 application.
-
Open the SAP BTP Trial by opening https://cockpit.hanatrial.ondemand.com/cockpit/#/home/trial in a new browser tab and click Go To Your Trial Account.
-
You're redirected to your personal SAP BTP Cockpit where your subaccounts are listed. Click on the preferred subaccount, e.g. trial.
-
Click the menu item Cloud Foundry and then Spaces. Until now, no space was created by you. Click Create Space.
-
In the popup, enter the space name, e.g. ui5-apps. Click Create.
To be able to display deployed UI5 applications we need the Launchpad Service in our trial account.
-
To subscribe to it, click on Service Marketplace and search the Launchpad Service.
-
Click on the Launchpad Service tile and then on Create on the right hand side
If you now click on Instance and Subscriptions you'll see that you have subscribed to the Launchpad Servcice.
Now you can login to your Cloud Foundry environment directly from SAP Business Application Studio.
- Open SAP Business Application Studio. Click in the header toolbar on View and then select Find Command.... Enter CF: Login to cloud foundry.
Now specify the user credentials:
After logging in you're asked to specify your desired Cloud Foundry organization and space:
Since you created your app using one of the application templates available in SAP Business Application Studio, all files which are located under sensormanager/test/
and sensormanager/localService/
are excluded from any build, because in a productive application these files are usually not needed. In our case the sensor data is placed in a local JSON file, so the sensors.json
file needs to be included in the build.
-
Open
sensormanager/ui5-deploy.yaml
. -
Remove the
"/localService/**"
entry for thebuilder
section.
sensormanager/ui5-deploy.yaml
builder:
resources:
excludes:
- "/test/**"
Now it's time to build your application. Yeah!
-
Right-click the
mta.yaml
file in the root folder. -
Select Build MTA Project. The build starts.
- Once the build has finished the terminal will display messages that the MTA archive has been generated and temporary files are cleaned up:
The build step has created a file named keepcool-sensormanager_0.0.1.mtar
located under mta_archives
. This file contains your build.
-
Right-click
mta_archives/keepcool-sensormanager_0.0.1.mtar
and select Deploy MTA Archive. Deployment starts. -
You are asked for the organisation and space again. Choose your trial account as organisation and the ui5-apps space you just created.
-
Deployment takes some time but should have finished after a few minutes, of which you'll be notified by in the terminal.
-
The deployed application can be started from the SAP BTP Cockpit. Go to your trial subaccount and click on the HTML5 Applications section at tjhe left hand side. The application is listed there as 'keepcoolsensormanager'. Click on it to start it.
-
Congratulations! You've deployed your UI5 application to the SAP BTP, Cloud Foundry runtime.
Hooray! You've completed successfully Exercise 10C - Deployment to SAP BTP, Cloud Foundry runtime.
Let's take a look at the additional exercises Additional exercises