forked from SAP-samples/cloud-cap-samples-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mta-multi-tenant.yaml
118 lines (118 loc) · 3.44 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
_schema-version: '2.1'
ID: bookshop-mt
version: 1.0.0
description: "Multitenant Bookshop CAP Java Project with UI"
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- npm install --production
- npx -p @sap/cds-dk cds build --production
modules:
# --------------------- SERVER MODULE ------------------------
- name: bookshop-mt-srv
# ------------------------------------------------------------
type: java
path: srv
parameters:
memory: 1024M
disk-quota: 256M
buildpack: sap_java_buildpack
properties:
SPRING_PROFILES_ACTIVE: cloud
CDS_MULTITENANCY_APPUI_TENANTSEPARATOR: "-"
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: sidecar
properties:
CDS_MULTITENANCY_SIDECAR_URL: ~{url}
- name: app
properties:
CDS_MULTITENANCY_APPUI_URL: ~{url}
- name: cf-logging
provides:
- name: srv
properties:
url: '${default-url}'
# --------------------- SIDECAR MODULE -----------------------
- name: bookshop-mt-sidecar
# ------------------------------------------------------------
type: nodejs
path: mtx-sidecar
parameters:
memory: 256M
disk-quota: 512M
requires:
- name: bookshop-mt-service-manager
- name: bookshop-mt-uaa
- name: cf-logging
provides:
- name: sidecar
properties:
url: ${default-url}
# --------------------- APPROUTER MODULE ---------------------
- name: bookshop-mt-app
# ------------------------------------------------------------
type: nodejs
path: app
parameters:
memory: 256M
disk-quota: 512M
properties:
TENANT_HOST_PATTERN: ^(.*)-${default-uri}
requires:
- name: srv
group: destinations
properties:
name: backend
url: ~{url}
forwardAuthToken: true
strictSSL: true
- name: bookshop-mt-uaa
provides:
- name: app
properties:
url: '${default-url}'
# --------------------- RESOURCES ---------------------
resources:
# -----------------------------------------------------
- name: bookshop-mt-uaa
type: com.sap.xs.uaa
parameters:
service: xsuaa
service-plan: broker
path: ./xs-security-mt.json
config: # override xsappname as it needs to be unique
xsappname: bookshop-mt-${org}-${space}
- 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/url}/mt/v1.0/subscriptions/dependencies
onSubscription: ~{srv/url}/mt/v1.0/subscriptions/tenants/{tenantId}
requires:
- name: srv
- name: cf-logging
type: org.cloudfoundry.managed-service
parameters:
service: application-logs
service-plan: lite