-
Notifications
You must be signed in to change notification settings - Fork 142
/
mta-multi-tenant.yaml
139 lines (139 loc) · 4.4 KB
/
mta-multi-tenant.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
_schema-version: '2.1'
ID: bookshop-mt
version: 1.0.0
description: "Multitenant Bookshop CAP Java Project with UI"
parameters:
enable-parallel-deployments: true
modules:
# --------------------- SERVER MODULE ------------------------
- name: bookshop-mt-srv
# ------------------------------------------------------------
type: java
path: srv
parameters:
memory: 1024M
disk-quota: 512M
buildpack: sap_java_buildpack_jakarta
health-check-type: http
health-check-http-endpoint: /actuator/health/liveness
readiness-health-check-type: http
readiness-health-check-http-endpoint: /actuator/health/readiness
properties:
SPRING_PROFILES_ACTIVE: cloud,sandbox
CDS_MULTITENANCY_APPUI_TENANTSEPARATOR: "-"
JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']"
JBP_CONFIG_SAP_MACHINE_JRE: '{ version: 21.+ }'
build-parameters:
builder: custom
commands:
- mvn clean package -DskipTests=true
build-result: target/*-exec.jar
requires:
- name: bookshop-mt-service-manager
- name: bookshop-mt-uaa
- name: bookshop-mt-saas-registry
- name: mtx-api
properties:
CDS_MULTITENANCY_SIDECAR_URL: ~{mtx-url}
- name: app-api
properties:
CDS_MULTITENANCY_APPUI_URL: ~{app-url}
- name: cf-logging
provides:
- name: srv-api
properties:
srv-url: '${default-url}'
# --------------------- SIDECAR MODULE -----------------------
- name: bookshop-mt-sidecar
# ------------------------------------------------------------
type: nodejs
path: mtx/sidecar
parameters:
memory: 256M
disk-quota: 1024M
build-parameters:
builder: custom
build-result: gen
commands:
- npm run build
requires:
- name: bookshop-mt-srv
requires:
- name: bookshop-mt-service-manager
- name: bookshop-mt-uaa
- name: cf-logging
provides:
- name: mtx-api
properties:
mtx-url: ${default-url}
# --------------------- APPROUTER MODULE ---------------------
- name: bookshop-mt-app
# ------------------------------------------------------------
type: approuter.nodejs
path: app
parameters:
memory: 256M
disk-quota: 512M
keep-existing-routes: true
properties:
TENANT_HOST_PATTERN: ^(.*)-${default-uri} # testing only, use custom domain with wildcard for production
requires:
- name: srv-api
group: destinations
properties:
name: backend
url: ~{srv-url}
forwardAuthToken: true
strictSSL: true
- name: bookshop-mt-uaa
provides:
- name: app-api
properties:
app-url: '${default-url}'
app-domain: '${domain}'
# --------------------- RESOURCES ---------------------
resources:
# -----------------------------------------------------
- name: bookshop-mt-uaa
type: org.cloudfoundry.managed-service
parameters:
service: xsuaa
service-plan: application
path: ./xs-security-mt.json
config: # override xsappname as it needs to be unique
xsappname: bookshop-mt-${org}-${space}
oauth2-configuration:
redirect-uris:
- https://*.~{app-api/app-domain}/**
requires:
- name: app-api
- name: bookshop-mt-service-manager
type: org.cloudfoundry.managed-service
parameters:
service: service-manager
service-plan: container
- name: bookshop-mt-saas-registry
type: org.cloudfoundry.managed-service
parameters:
service: saas-registry
service-plan: application
config:
appName: bookshop-mt-${org}-${space} # this is the text on the tile
xsappname: bookshop-mt-${org}-${space} # this is the value from xsuaa.parameters.config.xsappname
appUrls:
getDependencies: ~{srv-api/srv-url}/mt/v1.0/subscriptions/dependencies
onSubscription: ~{srv-api/srv-url}/mt/v1.0/subscriptions/tenants/{tenantId}
onSubscriptionAsync: true
onUnSubscriptionAsync: true
onUpdateDependenciesAsync: true
callbackTimeoutMillis: 3600000
displayName: bookshop-java
description: A simple CAP Java project.
category: 'Category'
requires:
- name: srv-api
- name: cf-logging
type: org.cloudfoundry.managed-service
parameters:
service: application-logs
service-plan: lite