Skip to Content
0

How to deploy UI5 applications to SCP (Neo) via an MTA file from the command line?

Aug 11, 2017 at 10:38 AM

489

avatar image

Hi,

I'm looking for a solution to deploy UI5 based application from the command line into SAP Cloud platform, in the "neo" flavour. Not on cloud foundry. I've read this guide (CI best practices - https://www.sap.com/developer/tutorials/ci-best-practices-fiori-sapcp.html ) which explains how to use the neo.sh and the mta.jar tools to generate and deploy the application.

I've tried and It works partially. From what I can gather, there is no way to specify that the applications requires UI5 as a dependency in the mta file. Because of this, once the app is deployed and started, it fails as it is expecting ui5 to be available under /resources (the convention set by the neo-app.json file) and it isn't.

In other words, How to i say the app needs UI5 and that it should be available under /resources ? Can't find examples for this anywhere. Am I missing something?

Thank you very much!

Sample mta file:

_schema-version: "2.0.0"
ID: "<Id of your MTA>"
version: <version number of your application>


parameters:
  hcp-deployer-version: "1.0.0"


modules:
  - name: "<Name of your Fiori application>"
    type: html5
    path: .
    parameters:
       version: <version number of your application>-${timestamp}
    build-parameters:
      builder: grunt
      build-result: dist
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Dimitar Aleksandrov
Aug 11, 2017 at 03:46 PM
0

Hello Tiago,

The dependency from the HTML5 application to the SAP UI5 is not currently modeled in the MTA descriptor.

In the new-app.json there are some default routes generated by the WebIDE that point to the SAP UI5 distribution.

It looks like the snipped below.

Please check if your route has the same target.

Best Regards,

Dimitar Aleksandrov

  "routes": [
    {
      "path": "/resources",
      "target": {
        "type": "service",
        "name": "sapui5",
        "entryPath": "/resources"
      },
      "description": "SAPUI5 Resources"
    },
    {
      "path": "/test-resources",
      "target": {
        "type": "service",
        "name": "sapui5",
        "entryPath": "/test-resources"
      },
      "description": "SAPUI5 Test Resources"
    }
  ],

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Dimitar,

Figured that if the mta.yaml lists the type as "com.sap.fiori.app" instead of "html5", the deployment then expects the mtar file do have a data.zip with an webapp folder inside. Like so:

data.zip

- webapp

-- Usual ui5 files & subfolders (controller, css, manifest.json)

neo-app.json

Deployment and activation works fine in those cases.

Regards,

0