ui5-community / generator-ui5-project

Generator for UI5-based web-apps which use the official UI5 tooling and support multiple deployment targets such as the SAP Business Technology Platform
Apache License 2.0
33 stars 25 forks source link

Deployed app is not visible in the html5-apps-repo #49

Closed archetypon closed 1 year ago

archetypon commented 1 year ago

Easy-Ui5 version:

3.4.0

OS/version:

Windows 10

Browser/version (+device/version):

Not relevant

Steps to reproduce the problem:

  1. Generate a new project (using platform SAP HTML5 Application Repository service for SAP BTP )
  2. run command npm run deploy

What is the expected result?

The app should be visible in the BTP cockpit under HTML5 Applications

What happens instead?

A configuration error is shown: - Destination [redacted] points to the html5-apps-repo instance [redacted], which does not contain any HTML5 applications. It could be that the HTML5 applications for the html5-apps-repo instance [redacted] were not uploaded correctly. You can try to redeploy the HTML5 applications.

Any other information? (attach screenshot if possible)

Please refer to this question, the last response resolve the issue.

nicoschoenteich commented 1 year ago

Hi @archetypon,

Good catch!

I believe we are actually missing two things:

  1. The additional configuration in the manifest.json:
    "sap.cloud": {
    "public": true,
    "service": "cloud.service"
    }
  2. The configuration of the destination content as a new module in the mta.yaml:
    - name: myUI5App_destination_content
      type: com.sap.application.content
      build-parameters:
        no-source: true
      requires:
        - name: myUI5App_uaa
          parameters:
            service-key:
              name: myUI5App_uaa_key
        - name: myUI5App_html5_repo_host
          parameters:
            service-key:
              name: myUI5App_html5_repo_host_key
        - name: myUI5App_destination
          parameters:
           content-target: true
      parameters:
        content:
          instance:
            existing_destinations_policy: update
            destinations:
              - Name: myUI5App_destination_html5
                ServiceInstanceName: myUI5App_html5_repo_host
                ServiceKeyName: myUI5App_html5_repo_host_key
                sap.cloud.service: cloud.service
              - Name: myUI5App_destination_uaa
                Authentication: OAuth2UserTokenExchange
                ServiceInstanceName: myUI5App_uaa
                ServiceKeyName: myUI5App_uaa_key
                sap.cloud.service: cloud.service

Adding both of those snippets fixes the issue and the application will be listed in the SAP BTP Cockpit under HTML5 Applications.

I will try to find out what options we have to build this into the generator. I will keep the issue open for reference.

Hope this helps.

BR, Nico

nicoschoenteich commented 1 year ago

Update:

I am currently working on a PR. Turns out that the configuration in the manifest.json (first point in the comment above) is only relevant when using the SAP Fiori Launchpad...