SAP / cf-html5-apps-repo-cli-plugin

Cloud Foundry CLI plugin to work with SAP Cloud HTML5 Applications Repository
Apache License 2.0
43 stars 5 forks source link

cf html5-push for a html5 module in a mta app #39

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hello,

I have the following project structure (HTML5 module in a multitarget application):

|-- mta_project
    |-- ui_module
    |    |-- dist
    |    |    |-- manifest.json
    |    |    |-- xs-app.json
    |    |    `-- ...
    |    |-- webapp
    |    |   |-- manifest.json
    |    |    `-- ...
    |    |-- xs-app.json
    |    `-- ...
    `-- ...

If I do: cf html5-push -r ui_module I receive the following message:

WARNING: Directory 'ui_module' is not an application and will not be pushed! FAILED Nothing to push. Make sure provided directories contain manifest.json and xs-app.json files

I assume it is because I only have the xs-app.json in that folder.

If I do: cf html5-push -r ui_module/webapp I receive the same message and I assume it is because I only have the manifest.json in that folder.

If I build with: mbt module-build and I give the path of the /dist folder like this: cf html5-push -r ui_module/dist This works and I am able to redeploy the HTML5 app, but the build takes to much time and my goal is to do only cf html5-push, which is fast.

Is there any way to give the path of the xs-app.json or manifest.json? Or any way of doing cf html5-push given this project structure, without doing the build?

Thank you!

micellius commented 4 years ago

Hi @StefaniaSantimbrean , Indeed, html5-push may only push folders containing both xs-app.json and manifest.json. If you'd like to push the sources (webapp folder), you can temporary copy xs-app.json to webapp folder, push html5 application and remove xs-app.json from webapp folder. With the single line script (assuming your current working directory is mta_project) it would be something like:

cp ui_module/xs-app.json ui_module/webapp && cf html5-push -r ui_module/webapp && rm ui_module/webapp/xs-app.json

Alternatively, if the problem is a long time of building the whole MTA, you can build a single module with:

mbt module-build -m=ui_module

and then push the dist forlder with cf html5-push ui_module/dist.