
mta.yaml
.mta.yaml
file, including upon which resources the editor module relies. Here's the entire contents of the mta.yaml
file:ID: businessruleseditor
_schema-version: '2.1'
parameters:
deploy_mode: html5-repo
version: 0.0.1
modules:
- name: businessruleseditor_appRouter
type: approuter.nodejs
path: businessruleseditor_appRouter
parameters:
disk-quota: 256M
memory: 256M
requires:
- name: businessruleseditor_html5_repo_runtime
- name: businessrules_uaa
- name: business-rules
resources:
- name: businessruleseditor_html5_repo_runtime
parameters:
service-plan: app-runtime
service: html5-apps-repo
type: org.cloudfoundry.managed-service
- name: business-rules
type: org.cloudfoundry.existing-service
- name: businessrules_uaa
type: com.sap.xs.uaa
parameters:
config:
xsappname: businessrules_uaa-appname
tenant-mode: dedicated
role-templates:
- name : UaaUser
description: Role template for accessing SAP Business Rule APIs.Editor via user token flow
scope-references:
- uaa.user
webide_mta_build.sh
. Here's an example of what the build output looks like:(MTA BUILD) Build of "cf-businessruleseditor" started.
(Executor) The "Task for mta build" process started.
(Executor) Starting process: "cd /projects/cf-businessruleseditor; webide_mta_build.sh"
(Executor) SAP Multitarget Application Archive Builder 1.1.20
(Executor) Module "businessruleseditor_appRouter": invoking npm install --production
(Executor) Module "businessruleseditor_appRouter": command output
(Executor) npm WARN deprecated scmp@1.0.0: scmp v2 uses improved core crypto comparison since Node v6.6.0
(Executor)
(Executor) > @sap/node-jwt@1.6.5 install /projects/cf-businessruleseditor/businessruleseditor_appRouter/node_modules/@sap/node-jwt
(Executor) > node ./build.js
(Executor)
(Executor) `linux-x64-v8-6.2` exists; testing
(Executor) Binary is fine; exiting
(Executor) npm notice created a lockfile as package-lock.json. You should commit this file.
(Executor) npm WARN html5-apps-approuter@ No repository field.
(Executor) npm WARN html5-apps-approuter@ No license field.
(Executor)
(Executor) added 236 packages from 133 contributors and audited 407 packages in 7.784s
(Executor) found 5 high severity vulnerabilities
(Executor) run `npm audit fix` to fix them, or `npm audit` for details
(Executor) Module "businessruleseditor_appRouter": zipping directory businessruleseditor_appRouter
(Executor) Generating archive /projects/cf-businessruleseditor/mta_archives/businessruleseditor_0.0.1.mtar
(Executor) Done
(Executor) adding: mta_archives/businessruleseditor_0.0.1.mtar (deflated 0%)
(mtaBuildTask) Build of "cf-businessruleseditor" completed.
businessruleseditor_0.0.1.mtar
created ready for deployment.(DeploymentToCF) Deployment of the "businessruleseditor" project started.
(DeployService) Deployment in progress.
(DeployService) Deploying /cf-businessruleseditor/mta_archives/businessruleseditor_0.0.1.mtar to endpoint: https://api.cf.eu10.hana.ondemand.com, organization: I347491trial_trial, space: dev.
(DeployService) Target: https://deploy-service.cfapps.eu10.hana.ondemand.com/slprot/I347491trial_trial/dev/slpPreparing to deploy /cf-businessruleseditor/mta_archives/businessruleseditor_0.0.1.mtarPrepare deployment filesChecking if there are conflicting processesFound 0 conflicting processesUploading mtar archiveStarting deploymentDeploying in org "I347491trial_trial" and space "dev"Detected MTA schema version: "3"Detected deployed MTA with ID "businessruleseditor" and version "0.0.1"Detected new MTA version: "0.0.1"Deployed MTA version: "0.0.1"Processing service "businessrules_uaa"...Processing service "businessruleseditor_html5_repo_runtime"...Updating service "businessrules_uaa"...Updating application "businessruleseditor_appRouter"...Application "businessruleseditor_appRouter" attributes are not modified and will not be updatedUploading application "businessruleseditor_appRouter"...Staging application "businessruleseditor_appRouter"...Application "businessruleseditor_appRouter" stagedStarting application "businessruleseditor_appRouter"...Application "businessruleseditor_appRouter" started and available at "i347491trial-trial-dev-businessruleseditor-approuter.cfapps.eu10.hana.ondemand.com"Deleting discontinued configuration entries for application "businessruleseditor_appRouter"...Skipping deletion of services, because the command line option "--delete-services" is not specified.To download logs of the process, use the multi-target application plug-in for the Cloud Foundry CLI command "cf dmol -i a040b006-2d32-11ea-aec7-eeee0a91b4b0" directly in your Cloud Foundry space.For more information see https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/e93b231895b64cbc9221a629535... finished successfully.
(DeploymentToCF) Could not fetch information for businessruleseditor
(DeploymentToCF) The "businessruleseditor" project has been deployed.
cf-businessruleseditor
project in the SAP Web IDE we see that there's hardly anything there at all - in particular, no application code. What this project does is bundle together, via configuration, things that already exist.ep48
), mainly to see that it (hopefully) survives the destruction and subsequent recreation of the app itself.cf api
which shows that we're connected to the EU10 (Europe - Frankfurt) CF area:qmacro@penguin:/tmp/ep48
-> cf api
api endpoint: https://api.cf.eu10.hana.ondemand.com
api version: 3.76.0
qmacro@penguin:/tmp/ep48
-> cf s
Getting services in org I347491trial_trial / space dev as dj.adams@sap.com...
name service plan bound apps last operation broker upgrade available
business-rules business-rules lite businessruleseditor_appRouter create succeeded sm-businessrules-e73ec4d2-a715-4849-a5e9-77b521e7a086
businessrules_uaa xsuaa application businessruleseditor_appRouter update succeeded sm-xsuaa-9ef36350-f975-4194-a399-54db361e79b5
businessruleseditor_html5_repo_runtime html5-apps-repo app-runtime businessruleseditor_appRouter create succeeded sm-html5-apps-repo-sb-ebcb2b69-24a5-408e-be00-02066b302b78
awk
to modify the output of cf s
and watch
to bring about a simple "monitor" effect, a basic equivalent of what we have in the cockpit, in tmux
panes.cf d businessruleseditor_appRouter -f
, and also the two services thus: cf ds businessrules_uaa
and cf ds businessruleseditor_html5_repo_runtime
, leaving us with just the business-rules
service itself.cf-businessruleseditor.zip
file from the SAP-samples/cloud-businessrules GitHub repo so we can start again with it locally in the terminal.tree
command thus:qmacro@penguin:/tmp/ep48
-> tree
.
└── cf-businessruleseditor
├── businessruleseditor_appRouter
│ ├── package.json
│ └── xs-app.json
└── mta.yaml
2 directories, 3 files
mta.yaml
file to change the name references for the Business Rules service from businessrules
to business-rules
, which we do at this point.--list-targets
which shows us a list of build targets:qmacro@penguin:/tmp/ep48/cf-businessruleseditor
-> java -jar ../mta_archive_builder-1.1.20.jar --list-targets
CF
NEO
XSA
qmacro@penguin:/tmp/ep48/cf-businessruleseditor
-> java -jar ../mta_archive_builder-1.1.20.jar --build-target=CF build
SAP Multitarget Application Archive Builder 1.1.20
Module "businessruleseditor_appRouter": invoking npm install --production
Module "businessruleseditor_appRouter": command output
npm WARN deprecated scmp@1.0.0: scmp v2 uses improved core crypto comparison since Node v6.6.0
> @sap/node-jwt@1.6.5 install /tmp/ep48/cf-businessruleseditor/businessruleseditor_appRouter/node_modules/@sap/node-jwt
> node ./build.js
`linux-x64-v8-6.8` exists; testing
Binary is fine; exiting
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN html5-apps-approuter@ No repository field.
npm WARN html5-apps-approuter@ No license field.
added 236 packages from 133 contributors and audited 407 packages in 10.082s
found 5 high severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
Module "businessruleseditor_appRouter": zipping directory businessruleseditor_appRouter
Generating archive /tmp/ep48/cf-businessruleseditor/cf-businessruleseditor.mtar
Done
cf-businessruleseditor.mtar
), but it's basically the same as what we had in the SAP Web IDE:qmacro@penguin:/tmp/ep48/cf-businessruleseditor
-> ls -l
total 11448
drwxr-xr-x 1 qmacro qmacro 132 Jan 2 08:32 businessruleseditor_appRouter
-rw------- 1 qmacro qmacro 11715381 Jan 2 08:32 cf-businessruleseditor.mtar
-rw-r--r-- 1 qmacro qmacro 1022 Sep 17 06:25 mta.yaml
cf plugins
, we see the plugins I've installed for my cf
command tool:qmacro@penguin:/tmp/ep48/cf-businessruleseditor
-> cf plugins
Listing installed plugins...
plugin version command name command help
multiapps 2.2.0 bg-deploy Deploy a multi-target app using blue-green deployment
multiapps 2.2.0 deploy Deploy a new multi-target app or sync changes to an existing one
multiapps 2.2.0 download-mta-op-logs, dmol Download logs of multi-target app operation
multiapps 2.2.0 mta Display health and status for a multi-target app
multiapps 2.2.0 mta-ops List multi-target app operations
multiapps 2.2.0 mtas List all multi-target apps
multiapps 2.2.0 purge-mta-config Purge no longer valid configuration entries
multiapps 2.2.0 undeploy Undeploy a multi-target app
Use 'cf repo-plugins' to list plugins in registered repos available to install.
cf deploy
:qmacro@penguin:/tmp/ep48/cf-businessruleseditor
-> cf deploy ./cf-businessruleseditor.mtar
Deploying multi-target app archive ./cf-businessruleseditor.mtar in org I347491trial_trial / space dev as dj.adams@sap.com...
Uploading 1 files...
/tmp/ep48/cf-businessruleseditor/cf-businessruleseditor.mtar
OK
Deploying in org "I347491trial_trial" and space "dev"
Detected MTA schema version: "3"
Detected deployed MTA with ID "businessruleseditor" and version "0.0.1"
Detected new MTA version: "0.0.1"
Deployed MTA version: "0.0.1"
Processing service "businessrules_uaa"...
Processing service "businessruleseditor_html5_repo_runtime"...
Updating service "businessrules_uaa"...
Updating application "businessruleseditor_appRouter"...
Application "businessruleseditor_appRouter" attributes are not modified and will not be updated
Uploading application "businessruleseditor_appRouter"...
Stopping application "businessruleseditor_appRouter"...
Staging application "businessruleseditor_appRouter"...
Application "businessruleseditor_appRouter" staged
Starting application "businessruleseditor_appRouter"...
Application "businessruleseditor_appRouter" started and available at "i347491trial-trial-dev-businessruleseditor-approuter.cfapps.eu10.hana.ondemand.com"
Deleting discontinued configuration entries for application "businessruleseditor_appRouter"...
Skipping deletion of services, because the command line option "--delete-services" is not specified.
Process finished.
Use "cf dmol -i 9086c32f-2d3c-11ea-b272-eeee0a8ae9c6" to download the logs of the process.
ep48
is still there (of course it is, we've only destroyed -- and recreated -- the editor app, not the project itself!).qmacro@penguin:/tmp/ep48
-> npm ls -g --depth=0
/home/qmacro/.config/nvm/versions/node/v10.17.0/lib
├── @sap/cds@3.20.1
├── mbt@1.0.5
└── npm@6.13.4
mbt
), which I did earlier with npm i -g mbt
.cf-businessruleseditor
project into it again, ready for a new build with mbt
. Of course, we have to remember to make the changes to mta.yaml
again but after that, we're set to go with the new build tool, which completes much more quickly too!qmacro@penguin:/tmp/ep48/cf-businessruleseditor
-> mbt build
[2020-01-02 09:05:26] INFO Cloud MTA Build Tool version 1.0.6
[2020-01-02 09:05:26] INFO generating the "Makefile_20200102090526.mta" file...
[2020-01-02 09:05:26] INFO done
[2020-01-02 09:05:26] INFO executing the "make -f Makefile_20200102090526.mta p=cf mtar= strict=true mode=" command...
[2020-01-02 09:05:26] INFO validating the MTA project
[2020-01-02 09:05:26] INFO validating the MTA project
[2020-01-02 09:05:26] INFO building the "businessruleseditor_appRouter" module...
[2020-01-02 09:05:26] INFO executing the "npm install --production" command...
....npm WARN deprecated scmp@1.0.0: scmp v2 uses improved core crypto comparison since Node v6.6.0
......
> @sap/node-jwt@1.6.5 install /tmp/ep48/cf-businessruleseditor/businessruleseditor_appRouter/node_modules/@sap/node-jwt
> node ./build.js
`linux-x64-v8-6.8` exists; testing
Binary is fine; exiting
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN html5-apps-approuter@ No repository field.
npm WARN html5-apps-approuter@ No license field.
added 236 packages from 133 contributors and audited 407 packages in 9.982s
found 5 high severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
[2020-01-02 09:05:36] INFO the build results of the "businessruleseditor_appRouter" module will be packed and saved in the "/tmp/ep48/cf-businessruleseditor/.cf-businessruleseditor_mta_build_tmp/businessruleseditor_appRouter" folder
[2020-01-02 09:05:38] INFO finished building the "businessruleseditor_appRouter" module
[2020-01-02 09:05:38] INFO generating the metadata...
[2020-01-02 09:05:38] INFO generating the MTA archive...
[2020-01-02 09:05:38] INFO the MTA archive generated at: /tmp/ep48/cf-businessruleseditor/mta_archives/businessruleseditor_0.0.1.mtar
[2020-01-02 09:05:38] INFO cleaning temporary files...
webide_mbt_build.sh
, as opposed to the one that was invoked with the deprecated build tool (webide_mta_build.sh
) earlier.mta_archives/businessruleseditor_0.0.1.mtar
. Deploying this in the same way as before (with cf deploy
) leads to success, too. Lovely!You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
25 | |
24 | |
17 | |
14 | |
10 | |
10 | |
9 | |
9 | |
8 | |
8 |