Skip to content

Commit 092cf19

Browse files
authored
Update @sap/cds-dk to 6.8.1 (#224)
Aligned MTA deployment files and MTX Sidecar configuration with best practices
1 parent 88bf46c commit 092cf19

File tree

8 files changed

+52
-75
lines changed

8 files changed

+52
-75
lines changed

.cdsrc.json

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,10 @@
55
"toggles": true
66
},
77
"build": {
8-
"target": ".",
9-
"tasks": [
10-
{
11-
"for": "java"
12-
},
13-
{
14-
"for": "mtx-sidecar"
15-
},
16-
{
17-
"for": "hana"
18-
}
19-
]
8+
"target": "."
209
},
21-
"hana": {
22-
"deploy-format": "hdbtable"
23-
}
10+
"profiles": [
11+
"with-mtx-sidecar",
12+
"java"
13+
]
2414
}

integration-tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@
118118
</plugin>
119119
</plugins>
120120
</build>
121-
</project>
121+
</project>

mta-multi-tenant.yaml

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ modules:
2828
- name: bookshop-mt-service-manager
2929
- name: bookshop-mt-uaa
3030
- name: bookshop-mt-saas-registry
31-
- name: sidecar
31+
- name: mtx-api
3232
properties:
33-
CDS_MULTITENANCY_SIDECAR_URL: ~{url}
34-
- name: app
33+
CDS_MULTITENANCY_SIDECAR_URL: ~{mtx-url}
34+
- name: app-api
3535
properties:
36-
CDS_MULTITENANCY_APPUI_URL: ~{url}
36+
CDS_MULTITENANCY_APPUI_URL: ~{app-url}
3737
- name: cf-logging
3838
provides:
39-
- name: srv
39+
- name: srv-api
4040
properties:
41-
url: '${default-url}'
41+
srv-url: '${default-url}'
4242
# --------------------- SIDECAR MODULE -----------------------
4343
- name: bookshop-mt-sidecar
4444
# ------------------------------------------------------------
@@ -59,40 +59,41 @@ modules:
5959
- name: bookshop-mt-uaa
6060
- name: cf-logging
6161
provides:
62-
- name: sidecar
62+
- name: mtx-api
6363
properties:
64-
url: ${default-url}
64+
mtx-url: ${default-url}
6565
# --------------------- APPROUTER MODULE ---------------------
6666
- name: bookshop-mt-app
6767
# ------------------------------------------------------------
68-
type: nodejs
68+
type: approuter.nodejs
6969
path: app
7070
parameters:
7171
memory: 256M
7272
disk-quota: 512M
73+
keep-existing-routes: true
7374
properties:
7475
TENANT_HOST_PATTERN: ^(.*)-${default-uri}
7576
requires:
76-
- name: srv
77+
- name: srv-api
7778
group: destinations
7879
properties:
7980
name: backend
80-
url: ~{url}
81+
url: ~{srv-url}
8182
forwardAuthToken: true
8283
strictSSL: true
8384
- name: bookshop-mt-uaa
8485
provides:
85-
- name: app
86+
- name: app-api
8687
properties:
87-
url: '${default-url}'
88+
app-url: '${default-url}'
8889
# --------------------- RESOURCES ---------------------
8990
resources:
9091
# -----------------------------------------------------
9192
- name: bookshop-mt-uaa
92-
type: com.sap.xs.uaa
93+
type: org.cloudfoundry.managed-service
9394
parameters:
9495
service: xsuaa
95-
service-plan: broker
96+
service-plan: application
9697
path: ./xs-security-mt.json
9798
config: # override xsappname as it needs to be unique
9899
xsappname: bookshop-mt-${org}-${space}
@@ -107,17 +108,20 @@ resources:
107108
service: saas-registry
108109
service-plan: application
109110
config:
110-
appName: bookshop-mt-${org}-${space} # this is the text on the tile
111-
xsappname: bookshop-mt-${org}-${space} # this is the value from xsuaa.parameters.config.xsappname
112-
appUrls:
113-
getDependencies: ~{srv/url}/mt/v1.0/subscriptions/dependencies
114-
onSubscription: ~{srv/url}/mt/v1.0/subscriptions/tenants/{tenantId}
115-
onSubscriptionAsync: true
116-
onUnSubscriptionAsync: true
117-
onUpdateDependenciesAsync: true
118-
callbackTimeoutMillis: 3600000
111+
appName: bookshop-mt-${org}-${space} # this is the text on the tile
112+
xsappname: bookshop-mt-${org}-${space} # this is the value from xsuaa.parameters.config.xsappname
113+
appUrls:
114+
getDependencies: ~{srv-api/srv-url}/mt/v1.0/subscriptions/dependencies
115+
onSubscription: ~{srv-api/srv-url}/mt/v1.0/subscriptions/tenants/{tenantId}
116+
onSubscriptionAsync: true
117+
onUnSubscriptionAsync: true
118+
onUpdateDependenciesAsync: true
119+
callbackTimeoutMillis: 3600000
120+
displayName: bookshop-java
121+
description: A simple CAP Java project.
122+
category: 'Category'
119123
requires:
120-
- name: srv
124+
- name: srv-api
121125
- name: cf-logging
122126
type: org.cloudfoundry.managed-service
123127
parameters:

mta-single-tenant.yaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ modules:
2828
- name: bookshop-uaa
2929
- name: cf-logging
3030
provides:
31-
- name: srv
31+
- name: srv-api
3232
properties:
33-
url: '${default-url}'
33+
srv-url: '${default-url}'
3434
# --------------------- DB MODULE ---------------------------
3535
- name: bookshop-db
3636
# -----------------------------------------------------------
@@ -49,32 +49,28 @@ modules:
4949
# --------------------- APPROUTER MODULE ---------------------
5050
- name: bookshop-app
5151
# ------------------------------------------------------------
52-
type: nodejs
52+
type: approuter.nodejs
5353
path: app
5454
parameters:
5555
memory: 256M
5656
disk-quota: 512M
5757
requires:
58-
- name: srv
58+
- name: srv-api
5959
group: destinations
6060
properties:
6161
name: backend
62-
url: ~{url}
62+
url: ~{srv-url}
6363
forwardAuthToken: true
6464
strictSSL: true
6565
- name: bookshop-uaa
66-
provides:
67-
- name: app
68-
properties:
69-
url: '${default-url}'
7066
# --------------------- RESOURCES ---------------------
7167
resources:
7268
# -----------------------------------------------------
7369
- name: bookshop-uaa
74-
type: com.sap.xs.uaa
70+
type: org.cloudfoundry.managed-service
7571
parameters:
7672
service: xsuaa
77-
service-plan: broker
73+
service-plan: application
7874
path: ./xs-security.json
7975
config: # override xsappname as it needs to be unique
8076
xsappname: bookshop-${org}-${space}

mtx/sidecar/package.json

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,10 @@
22
"dependencies": {
33
"@sap/cds": "^6",
44
"@sap/cds-mtxs": "^1",
5+
"@sap/xssec": "^3",
56
"express": "^4",
67
"hdb": "^0",
7-
"passport": "^0",
8-
"@sap/xssec": "^3"
9-
},
10-
"cds": {
11-
"requires": {
12-
"[production]": {
13-
"db": "hana-mt",
14-
"auth": "xsuaa"
15-
},
16-
"[development]": {
17-
"db": "sqlite",
18-
"auth": "dummy"
19-
},
20-
"cds.xt.ModelProviderService": "in-sidecar",
21-
"cds.xt.DeploymentService": true,
22-
"cds.xt.SaasProvisioningService": true,
23-
"cds.xt.ExtensibilityService": true
24-
}
8+
"passport": "^0"
259
},
2610
"devDependencies": {
2711
"sqlite3": "^5",
@@ -30,8 +14,11 @@
3014
"engines": {
3115
"node": "^16"
3216
},
17+
"cds": {
18+
"profile": "mtx-sidecar"
19+
},
3320
"scripts": {
3421
"start": "cds-serve",
35-
"build": "npm install && npx cds build ../.. --for mtx-sidecar && cd gen && npm install"
22+
"build": "cds build ../.. --for mtx-sidecar --production && cd gen && npm install"
3623
}
3724
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<cloud.sdk.version>4.12.0</cloud.sdk.version>
2222
<xsuaa.version>2.13.9</xsuaa.version>
2323
<cf-java-logging-support.version>3.7.0</cf-java-logging-support.version>
24-
<cds.install-cdsdk.version>6.7.2</cds.install-cdsdk.version>
24+
<cds.install-cdsdk.version>6.8.1</cds.install-cdsdk.version>
2525
</properties>
2626

2727
<modules>

requests.http

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Authorization: Basic authenticated:
88

99
### Subscribe t1 tenant, in local-mtxs
1010

11-
POST http://localhost:4004/-/cds/deployment/subscribe HTTP/1.1
11+
POST http://localhost:4005/-/cds/deployment/subscribe HTTP/1.1
1212
Content-Type: application/json
1313

1414
{

srv/src/main/resources/application.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ cds:
9999
spring:
100100
config.activate.on-profile: ft
101101
cds:
102-
model.provider.url: http://localhost:4004
102+
model.provider.url: http://localhost:4005
103103
security.mock.users:
104104
admin:
105105
features:
@@ -113,7 +113,7 @@ cds:
113113
spring:
114114
config.activate.on-profile: local-mtxs
115115
cds:
116-
multi-tenancy.sidecar.url: http://localhost:4004
116+
multi-tenancy.sidecar.url: http://localhost:4005
117117
security.mock.users:
118118
admin:
119119
tenant: t1

0 commit comments

Comments
 (0)