Compare commits
1 Commits
hierarch-d
...
deploy/mul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6906e68142 |
@@ -1,6 +1,11 @@
|
|||||||
{
|
{
|
||||||
"welcomeFile": "app/bookshop/index.html",
|
"welcomeFile": "app/bookshop/index.html",
|
||||||
"routes": [
|
"routes": [
|
||||||
|
{
|
||||||
|
"source": "^/-/cds/.*",
|
||||||
|
"destination": "mtx-api",
|
||||||
|
"authenticationType": "none"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"source": "^/app/(.*)$",
|
"source": "^/app/(.*)$",
|
||||||
"target": "$1",
|
"target": "$1",
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
"@sap-cloud-sdk/resilience": "^4",
|
"@sap-cloud-sdk/resilience": "^4",
|
||||||
"@sap/cds": ">=5",
|
"@sap/cds": ">=5",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"@cap-js/hana": "^1"
|
"@cap-js/hana": "^1",
|
||||||
|
"@sap/cds-mtxs": "^2"
|
||||||
},
|
},
|
||||||
"cds": {
|
"cds": {
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -24,7 +25,10 @@
|
|||||||
"model": "@capire/orders"
|
"model": "@capire/orders"
|
||||||
},
|
},
|
||||||
"messaging": true,
|
"messaging": true,
|
||||||
"db": true
|
"db": true,
|
||||||
|
"multitenancy": true,
|
||||||
|
"auth": "xsuaa"
|
||||||
|
|
||||||
},
|
},
|
||||||
"log": { "service": true }
|
"log": { "service": true }
|
||||||
},
|
},
|
||||||
|
|||||||
79
mta.yaml
79
mta.yaml
@@ -9,7 +9,7 @@ build-parameters:
|
|||||||
- builder: custom
|
- builder: custom
|
||||||
commands:
|
commands:
|
||||||
- npm ci
|
- npm ci
|
||||||
- npx cds build shared-db --for hana --production
|
- npx cds build --production
|
||||||
- npx cds build orders --for nodejs --production --ws-pack
|
- npx cds build orders --for nodejs --production --ws-pack
|
||||||
- npx cds build reviews --for nodejs --production
|
- npx cds build reviews --for nodejs --production
|
||||||
- npx cds build bookstore --for nodejs --production --ws-pack
|
- npx cds build bookstore --for nodejs --production --ws-pack
|
||||||
@@ -78,14 +78,6 @@ modules:
|
|||||||
- name: samples-auth
|
- name: samples-auth
|
||||||
- name: samples-destination
|
- name: samples-destination
|
||||||
|
|
||||||
- name: samples-db-deployer
|
|
||||||
type: hdb
|
|
||||||
path: shared-db/gen/db
|
|
||||||
parameters:
|
|
||||||
buildpack: nodejs_buildpack
|
|
||||||
requires:
|
|
||||||
- name: samples-db
|
|
||||||
|
|
||||||
- name: samples
|
- name: samples
|
||||||
type: approuter.nodejs
|
type: approuter.nodejs
|
||||||
path: .deploy/app-router
|
path: .deploy/app-router
|
||||||
@@ -93,6 +85,8 @@ modules:
|
|||||||
keep-existing-routes: true
|
keep-existing-routes: true
|
||||||
disk-quota: 256M
|
disk-quota: 256M
|
||||||
memory: 256M
|
memory: 256M
|
||||||
|
properties:
|
||||||
|
TENANT_HOST_PATTERN: "^(.*)-${default-uri}"
|
||||||
requires:
|
requires:
|
||||||
- name: orders-api
|
- name: orders-api
|
||||||
group: destinations
|
group: destinations
|
||||||
@@ -112,7 +106,17 @@ modules:
|
|||||||
name: bookstore-api # must be used in xs-app.json as well
|
name: bookstore-api # must be used in xs-app.json as well
|
||||||
url: ~{srv-url}
|
url: ~{srv-url}
|
||||||
forwardAuthToken: true
|
forwardAuthToken: true
|
||||||
|
- name: mtx-api
|
||||||
|
group: destinations
|
||||||
|
properties:
|
||||||
|
name: mtx-api # must be used in xs-app.json as well
|
||||||
|
url: ~{mtx-url}
|
||||||
- name: samples-auth
|
- name: samples-auth
|
||||||
|
provides:
|
||||||
|
- name: app-api
|
||||||
|
properties:
|
||||||
|
app-protocol: ${protocol}
|
||||||
|
app-uri: ${default-uri}
|
||||||
|
|
||||||
- name: destination-content
|
- name: destination-content
|
||||||
type: com.sap.application.content
|
type: com.sap.application.content
|
||||||
@@ -145,6 +149,27 @@ modules:
|
|||||||
TokenServiceInstanceName: samples-auth
|
TokenServiceInstanceName: samples-auth
|
||||||
TokenServiceKeyName: xsuaa-service-key
|
TokenServiceKeyName: xsuaa-service-key
|
||||||
|
|
||||||
|
- name: samples-mtx
|
||||||
|
type: nodejs
|
||||||
|
path: gen/mtx/sidecar
|
||||||
|
build-parameters:
|
||||||
|
builder: npm
|
||||||
|
parameters:
|
||||||
|
instances: 1
|
||||||
|
memory: 256M
|
||||||
|
disk-quota: 512M
|
||||||
|
provides:
|
||||||
|
- name: mtx-api
|
||||||
|
properties:
|
||||||
|
mtx-url: ${default-url}
|
||||||
|
requires:
|
||||||
|
- name: samples-db
|
||||||
|
- name: samples-registry
|
||||||
|
- name: samples-auth
|
||||||
|
- name: app-api
|
||||||
|
properties:
|
||||||
|
SUBSCRIPTION_URL: ~{app-protocol}://\${tenant_subdomain}-~{app-uri}
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- name: samples-messaging
|
- name: samples-messaging
|
||||||
type: org.cloudfoundry.managed-service
|
type: org.cloudfoundry.managed-service
|
||||||
@@ -156,23 +181,51 @@ resources:
|
|||||||
emname: bookstore-${org}-${space}
|
emname: bookstore-${org}-${space}
|
||||||
namespace: cap/samples/${space}
|
namespace: cap/samples/${space}
|
||||||
- name: samples-db
|
- name: samples-db
|
||||||
type: com.sap.xs.hdi-container
|
type: org.cloudfoundry.managed-service
|
||||||
parameters:
|
parameters:
|
||||||
service: hana
|
service: service-manager
|
||||||
service-plan: hdi-shared
|
service-plan: container
|
||||||
|
|
||||||
- name: samples-auth
|
- name: samples-auth
|
||||||
type: org.cloudfoundry.managed-service
|
type: org.cloudfoundry.managed-service
|
||||||
processed-after:
|
processed-after:
|
||||||
- samples-messaging
|
- samples-messaging
|
||||||
|
requires:
|
||||||
|
- name: app-api
|
||||||
parameters:
|
parameters:
|
||||||
service: xsuaa
|
service: xsuaa
|
||||||
service-plan: application
|
service-plan: application
|
||||||
path: ./xs-security.json
|
path: ./xs-security.json
|
||||||
config:
|
config:
|
||||||
xsappname: samples-${org}-${space}
|
xsappname: samples-${org}-${space}
|
||||||
tenant-mode: dedicated
|
tenant-mode: shared
|
||||||
|
oauth2-configuration:
|
||||||
|
redirect-uris:
|
||||||
|
- https://*-~{app-api/app-uri}/**
|
||||||
|
|
||||||
- name: samples-destination
|
- name: samples-destination
|
||||||
type: org.cloudfoundry.managed-service
|
type: org.cloudfoundry.managed-service
|
||||||
parameters:
|
parameters:
|
||||||
service: destination
|
service: destination
|
||||||
service-plan: lite
|
service-plan: lite
|
||||||
|
|
||||||
|
- name: samples-registry
|
||||||
|
type: org.cloudfoundry.managed-service
|
||||||
|
requires:
|
||||||
|
- name: mtx-api
|
||||||
|
parameters:
|
||||||
|
service: saas-registry
|
||||||
|
service-plan: application
|
||||||
|
config:
|
||||||
|
xsappname: samples-${org}-${space}
|
||||||
|
appName: samples-${org}-${space}
|
||||||
|
displayName: samples-shared-db
|
||||||
|
description: CAP Samples with shared-db and multitenancy
|
||||||
|
category: 'Samples shared-db'
|
||||||
|
appUrls:
|
||||||
|
getDependencies: ~{mtx-api/mtx-url}/-/cds/saas-provisioning/dependencies
|
||||||
|
onSubscription: ~{mtx-api/mtx-url}/-/cds/saas-provisioning/tenant/{tenantId}
|
||||||
|
onSubscriptionAsync: true
|
||||||
|
onUnSubscriptionAsync: true
|
||||||
|
onUpdateDependenciesAsync: true
|
||||||
|
callbackTimeoutMillis: 300000 # Increase if your deployments are taking longer than that
|
||||||
|
|||||||
19
mtx/sidecar/package.json
Normal file
19
mtx/sidecar/package.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"name": "samples-mtx",
|
||||||
|
"dependencies": {
|
||||||
|
"@cap-js/hana": "^1",
|
||||||
|
"@sap/cds": "^8",
|
||||||
|
"@sap/cds-mtxs": "^2",
|
||||||
|
"@sap/xssec": "^4",
|
||||||
|
"express": "^4"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@cap-js/sqlite": "^1"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "cds-serve"
|
||||||
|
},
|
||||||
|
"cds": {
|
||||||
|
"profile": "mtx-sidecar"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,12 +5,15 @@
|
|||||||
"@cap-js/hana": "^1",
|
"@cap-js/hana": "^1",
|
||||||
"@capire/common": "*",
|
"@capire/common": "*",
|
||||||
"@sap/cds": ">=5",
|
"@sap/cds": ">=5",
|
||||||
"@sap/xssec": "^4"
|
"@sap/xssec": "^4",
|
||||||
|
"@sap/cds-mtxs": "^2"
|
||||||
},
|
},
|
||||||
"cds": {
|
"cds": {
|
||||||
"requires": {
|
"requires": {
|
||||||
"messaging": true,
|
"messaging": true,
|
||||||
"db": true
|
"db": true,
|
||||||
|
"multitenancy": true,
|
||||||
|
"auth": "xsuaa"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
12
package.json
12
package.json
@@ -33,5 +33,15 @@
|
|||||||
"timeout": 6666
|
"timeout": 6666
|
||||||
},
|
},
|
||||||
"license": "SEE LICENSE IN LICENSE",
|
"license": "SEE LICENSE IN LICENSE",
|
||||||
"private": true
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@sap/cds-mtxs": "^2"
|
||||||
|
},
|
||||||
|
"cds": {
|
||||||
|
"profile": "with-mtx-sidecar",
|
||||||
|
"requires": {
|
||||||
|
"multitenancy": true,
|
||||||
|
"auth": "xsuaa"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -10,12 +10,15 @@
|
|||||||
"@cap-js/hana": "^1",
|
"@cap-js/hana": "^1",
|
||||||
"@sap/cds": ">=5",
|
"@sap/cds": ">=5",
|
||||||
"@sap/xssec": "^4.2.7",
|
"@sap/xssec": "^4.2.7",
|
||||||
"express": "^4.17.1"
|
"express": "^4.17.1",
|
||||||
|
"@sap/cds-mtxs": "^2"
|
||||||
},
|
},
|
||||||
"cds": {
|
"cds": {
|
||||||
"requires": {
|
"requires": {
|
||||||
"messaging": true,
|
"messaging": true,
|
||||||
"db": true
|
"db": true,
|
||||||
|
"multitenancy": true,
|
||||||
|
"auth": "xsuaa"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -14,6 +14,13 @@
|
|||||||
{
|
{
|
||||||
"name": "$XSAPPNAME.emmanagement",
|
"name": "$XSAPPNAME.emmanagement",
|
||||||
"description": "Enterprise-Messaging Management Access"
|
"description": "Enterprise-Messaging Management Access"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "$XSAPPNAME.mtcallback",
|
||||||
|
"description": "Subscription via SaaS Registry",
|
||||||
|
"grant-as-authority-to-apps": [
|
||||||
|
"$XSAPPNAME(application,sap-provisioning,tenant-onboarding)"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
|
|||||||
Reference in New Issue
Block a user