forked from SAP-samples/cap-sflight
-
Notifications
You must be signed in to change notification settings - Fork 2
/
mta.yaml
202 lines (188 loc) · 6.25 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
_schema-version: "3.2"
ID: capire.sflight
version: 1.0.0
description: "CAP sflight demo"
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
# set 'CDS_ENV=node' to pick the 'node' build profile settings, defined in package.json
- npx -p @sap/cds-dk cds build --profile production,node
modules:
# --------------------- SERVER MODULE ------------------------
- name: sflight-srv
# ------------------------------------------------------------
type: nodejs
path: gen/srv
requires:
- name: sflight-db
- name: sflight-uaa
provides:
- name: srv-api # required by consumers of CAP services (e.g. approuter, destinations)
properties:
srv-url: ${default-url}
build-parameters:
builder: npm-ci
ignore: ["node_modules/"]
# -------------------- SIDECAR MODULE ------------------------
- name: sflight-db-deployer
# ------------------------------------------------------------
type: hdb
path: gen/db
parameters:
buildpack: nodejs_buildpack
requires:
- name: sflight-db
- name: sflight-uaa
build-parameters:
ignore: ["node_modules/"]
# ------------------ APPLICATION CONTENT ---------------------
- name: sflight-appcontent
# ------------------------------------------------------------
type: com.sap.application.content
path: app
requires:
- name: sflight-destination-service
- name: sflight-html5-repo-host
parameters:
content-target: true
build-parameters:
build-result: resources
requires:
- name: sflight-app-travel-processor
artifacts:
- travel-processor.zip
target-path: resources/
- name: sflight-app-travel-analytics
artifacts:
- travel-analytics.zip
target-path: resources/
# ------------- APPLICATION: TRAVEL PROCESSOR ----------------
- name: sflight-app-travel-processor
# ------------------------------------------------------------
type: html5
path: app/travel_processor
build-parameters:
build-result: dist
builder: custom
commands:
- npm ci
- npm run build
supported-platforms: []
# ------------- APPLICATION: TRAVEL ANALYTICS ----------------
- name: sflight-app-travel-analytics
# ------------------------------------------------------------
type: html5
path: app/travel_analytics
build-parameters:
build-result: dist
builder: custom
commands:
- npm ci
- npm run build
supported-platforms: []
# ------------------ DESTINATION CONTENT ---------------------
- name: sflight-destinationcontent
# ------------------------------------------------------------
type: com.sap.application.content
build-parameters:
no-source: true
requires:
- name: sflight-uaa
parameters:
service-key:
name: sflight-uaa-key
- name: sflight-html5-repo-host
parameters:
service-key:
name: sflight-html5-repo-host-key
- name: sflight-destination-service
parameters:
content-target: true
parameters:
content:
instance:
existing_destinations_policy: update
destinations:
- Name: sflight-html5-repository
ServiceInstanceName: sflight-html5-repo-host
ServiceKeyName: sflight-html5-repo-host-key
sap.cloud.service: sap.fe.cap.sflight
- Name: sflight-uaa
Authentication: OAuth2UserTokenExchange
ServiceInstanceName: sflight-uaa
ServiceKeyName: sflight-uaa-key
sap.cloud.service: sap.fe.cap.sflight
resources:
# ------------------------------------------------------------
- name: sflight-db
# ------------------------------------------------------------
type: com.sap.xs.hdi-container
parameters:
service: hana
service-plan: hdi-shared
properties:
hdi-service-name: ${service-name}
# ------------------------------------------------------------
- name: sflight-uaa
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
parameters:
service: xsuaa
service-plan: application
path: ./app/travel_processor/xs-security.json
config:
xsappname: sflight-${space}
tenant-mode: dedicated
role-collections:
- name: 'sflight-reviewer-${space}'
description: Review travels
role-template-references:
- $XSAPPNAME.reviewer
- name: 'sflight-processor-${space}'
description: Process travels
role-template-references:
- $XSAPPNAME.processor
- name: 'sflight-admin-${space}'
description: Manage travels
role-template-references:
- $XSAPPNAME.admin
# ------------------------------------------------------------
- name: sflight-html5-repo-runtime
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
parameters:
service: html5-apps-repo
service-plan: app-runtime
# ------------------------------------------------------------
- name: sflight-html5-repo-host
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
parameters:
service: html5-apps-repo
service-plan: app-host
# ------------------------------------------------------------
- name: sflight-destination-service
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
requires:
- name: srv-api
parameters:
service: destination
service-plan: lite
config:
version: 1.0.0
HTML5Runtime_enabled: true
init_data:
instance:
existing_destinations_policy: update
destinations:
- Name: sflight-srv
URL: ~{srv-api/srv-url}
Authentication: NoAuthentication
Type: HTTP
ProxyType: Internet
HTML5.ForwardAuthToken: true
HTML5.DynamicDestination: true