This repository has been archived by the owner on Nov 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathmta.yaml
267 lines (247 loc) · 8.13 KB
/
mta.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
_schema-version: "3.1"
ID: author-readings
description: "SAP Partner Reference Application v1.1"
version: 1.1.0
parameters:
displayname: SME Partner Reference Sample Application v1.1
xsappname: author-reading-${org}-${space}
app-url: ${org}-${space}
approuter-url: ${app-url}-approuter
srv-url: ${app-url}-srv
mtx-srv-url: ${app-url}-mtx-srv
deploy_mode: html5-repo
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- npm ci --production
- npx -p @sap/cds-dk cds build --production
# -------------------------------------------------------------------------
# Modules
# -------------------------------------------------------------------------
modules:
# Application Router Module
- name: author-readings-approuter
type: nodejs
path: approuter
parameters:
disk-quota: 256M
memory: 256M
routes:
- route: ${approuter-url}.${domain}
- route: "*.${app-url}.${domain}"
provides:
- name: approuter-binding
properties:
app-url: ${protocol}://${approuter-url}.${domain}
requires:
- name: srv-api
group: destinations
properties:
name: srv-api # Compare ./app/authorreadingmanager/xs-app.json
url: ~{srv-url}
forwardAuthToken: true
- name: author-readings-uaa
- name: author-readings-destination-service
- name: author-readings-auditlog
- name: author-readings-registry
- name: author-readings-html5-runtime
properties:
TENANT_HOST_PATTERN: "^(.*).${app-url}.${domain}"
httpHeaders: "[{ \"Content-Security-Policy\": \"frame-ancestors 'self' https://*.hana.ondemand.com\" }]" # Allow the SAP launchpad to host the app in-place
CORS:
- uriPattern: .*
allowedOrigin:
- host: "*.${app-url}.${domain}"
protocol: "https"
# Service Module
- name: author-readings-srv
type: nodejs
path: gen/srv
requires:
- name: author-readings-service-manager
- name: author-readings-uaa
- name: author-readings-destination-service
- name: author-readings-auditlog
- name: author-readings-registry
provides:
- name: srv-api
properties:
srv-url: ${protocol}://${srv-url}.${domain} # ${default-url}
redirect-uris: ${protocol}://*.${app-url}.${domain}/** # Redirect URI to connect modules running on different CF landscapes
- name: srv-multi-tenancy
properties:
tenant-delimiter: "."
parameters:
buildpack: nodejs_buildpack
disk-quota: 1024M
memory: 512M
routes:
- route: ${srv-url}.${domain}
properties:
SUBSCRIPTION_URL: ${protocol}://\${tenant_subdomain}.${srv-url}.${domain} # ${default-url}
# Multi Tenancy Service Module (Onboarding, Upgrading)
- name: author-readings-mtx-srv
type: nodejs
path: gen/srv
requires:
- name: author-readings-auditlog
- name: author-readings-uaa
- name: author-readings-destination-service
- name: author-readings-service-manager
properties:
SUBSCRIPTION_URL: ${protocol}://\${tenant_subdomain}.${app-url}.${domain}/authorreadingmanager # ${default-url}
parameters:
disk-quota: 1024M
memory: 512M
routes:
- route: ${mtx-srv-url}.${domain}
provides:
- name: mtx-binding
properties:
app-url: ${protocol}://${mtx-srv-url}.${domain}
- name: author-readings-mtx-srv-destination
public: true
properties:
name: mtx-srv-api
url: ${protocol}://${mtx-srv-url}.${domain}
forwardAuthToken: true
- name: mtx-srv-api # required by consumers of CAP services (e.g. approuter)
properties:
mtx-srv-url: ${protocol}://${mtx-srv-url}.${domain} # ${default-url}
# App UI Content Deployer Module (deploy web app content into the HTML5 application repository)
- name: author-readings-app-deployer
type: com.sap.application.content
path: gen
requires:
- name: author-readings-html5-repo-host
parameters:
content-target: true
- name: author-readings-uaa
build-parameters:
build-result: resources
requires:
- artifacts:
- authorreadingmanager.zip
name: authorreadingmanager
target-path: resources/
# App UI Resource Module
- name: authorreadingmanager
type: html5
path: app/authorreadingmanager
build-parameters:
build-result: dist
builder: custom
commands:
- npm install
- npm run build:cf
supported-platforms: []
# The service broker for the author reading service.
# Exposes the URL where to find the author reading service.
- name: author-readings-servicebroker
type: nodejs
path: broker
parameters:
disk-quota: 1024M
memory: 128M
health-check-timeout: 180
requires:
- name: author-readings-uaa
- name: srv-api
build-parameters:
builder: npm
properties:
SBF_CATALOG_SUFFIX: ${space} # Make the service broker unique in the deployed space
SBF_ENABLE_AUDITLOG: false
# TO-DO: Enter service broker user and password
#SBF_BROKER_CREDENTIALS: '{ "<BrokerUser>": "<BrokerPassword>" }' # use command "npx hash-broker-password -b" and generate a random password and hashes it ( use the plain password in mta.yaml )
#SBF_BROKER_CREDENTIALS: '{ "${generated-user}": "${generated-password}" }' # user could opt to use random generated user and password everytime the mta.yaml is deployed ( but this option will generate the password with every deployment)
SBF_SERVICE_CONFIG:
authorreadings:
extend_xssecurity:
per_plan:
standard:
authorities:
- "$XSMASTERAPPNAME.authorreadingsapi"
extend_credentials:
per_plan:
standard:
endpoints:
authorreadings: "~{srv-api/srv-url}" # Tenant-specific OData endpoint for remote integrations
# -------------------------------------------------------------------------
# Resources
# -------------------------------------------------------------------------
resources:
# Service Manager
- name: author-readings-service-manager
type: org.cloudfoundry.managed-service
parameters:
service: service-manager
service-plan: container
properties:
hdi-service-name: ${service-name}
# Destination Service
- name: author-readings-destination-service
type: org.cloudfoundry.managed-service
parameters:
service: destination
service-plan: lite
config:
HTML5Runtime_enabled: true
# UAA service (Authorization and Trust Management Service)
- name: author-readings-uaa
type: org.cloudfoundry.managed-service
requires:
- name: srv-api
parameters:
config:
tenant-mode: shared
xsappname: ${xsappname}
oauth2-configuration:
redirect-uris:
- ~{srv-api/redirect-uris} # Redirect to connect modules running on different CF landscapes
- http://localhost # Redirect for local testing using Postman
path: ./xs-security.json
service: xsuaa
service-name: author-readings-uaa
service-plan: broker
# Audit Log Service
- name: author-readings-auditlog
type: org.cloudfoundry.managed-service
parameters:
service: auditlog
service-plan: oauth2
# Service Registry (SaaS Provisioning Service)
- name: author-readings-registry
type: org.cloudfoundry.managed-service
requires:
- name: mtx-binding
- name: approuter-binding
parameters:
service: saas-registry
service-plan: application
config:
xsappname: ${xsappname}
appName: ${xsappname}
displayName: ${displayname}
description: ${displayname}
category: 'Category'
appUrls:
getDependencies: ~{approuter-binding/app-url}/-/cds/saas-provisioning/dependencies
onSubscription: ~{mtx-binding/app-url}/-/cds/saas-provisioning/tenant/{tenantId}
callbackTimeoutMillis: 300000
# HTML5 Runtime (HTML5 Application Repository Service)
- name: author-readings-html5-runtime
type: org.cloudfoundry.managed-service
parameters:
service: html5-apps-repo
service-plan: app-runtime
# HTML5 Repository (HTML5 Application Repository Service)
- name: author-readings-html5-repo-host
type: org.cloudfoundry.managed-service
parameters:
service: html5-apps-repo
service-plan: app-host
config:
sizeLimit: 10