@sap/cds-dk 6.4.0 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -1
- package/bin/bind.js +30 -34
- package/bin/cds.js +14 -3
- package/bin/deploy/index.js +3 -1
- package/bin/deploy/to-sqlite.js +2 -1
- package/bin/env.js +4 -4
- package/bin/migrate.js +25 -4
- package/bin/push.js +4 -0
- package/bin/watch.js +3 -3
- package/lib/bind/KubernetesApiAccessor.js +79 -0
- package/lib/bind/{BindingManager.js → bindingManager.js} +16 -15
- package/lib/bind/bindingResolver.js +41 -68
- package/lib/bind/bindingUtil.js +93 -104
- package/lib/bind/cfKeyProvider.js +85 -74
- package/lib/bind/kubernetesCredentialsProvider.js +34 -132
- package/lib/bind/userCdsrcJsonStorageProvider.js +12 -18
- package/lib/client/params.js +2 -2
- package/lib/client/push.js +11 -6
- package/lib/client/settings_manager.js +2 -1
- package/lib/client/subscription.js +4 -1
- package/lib/import/odata/v2parser.js +32 -8
- package/lib/import/odata/v4parser.js +11 -3
- package/lib/init/constants.js +1 -1
- package/lib/init/index.js +3 -11
- package/lib/init/template/approuter/files/approuter-configmap.yaml +4 -1
- package/lib/init/template/approuter/files/approuter-mtxs-configmap.yaml +5 -1
- package/lib/init/template/approuter/files/package.json +1 -1
- package/lib/init/template/approuter/files/values.yaml.hbs +1 -1
- package/lib/init/template/approuter/files/xs-app.json.hbs +2 -2
- package/lib/init/template/approuter/index.js +4 -5
- package/lib/init/template/auditlog/index.js +1 -1
- package/lib/init/template/data/index.js +1 -1
- package/lib/init/template/destinations/index.js +1 -1
- package/lib/init/template/enterprise-messaging/index.js +1 -1
- package/lib/init/template/extensibility/index.js +6 -1
- package/lib/init/template/hana/files/chart.yaml +4 -0
- package/lib/init/template/hana/files/hana.yaml +1 -0
- package/lib/init/template/hana/files/java/db/package.json +1 -1
- package/lib/init/template/hana/files/values.yaml.hbs +6 -3
- package/lib/init/template/hana/index.js +73 -21
- package/lib/init/template/helm/chart/templates/_deployment_helpers.tpl +14 -6
- package/lib/init/template/helm/chart/values.root.schema.json +10 -0
- package/lib/init/template/helm/chart/values.schema.json +11 -110
- package/lib/init/template/helm/index.js +2 -2
- package/lib/init/template/helm/subcharts/content-deployment/Chart.yaml +5 -0
- package/lib/init/template/helm/subcharts/content-deployment/templates/_helpers.tpl +207 -0
- package/lib/init/template/helm/subcharts/content-deployment/templates/job.yaml +66 -0
- package/lib/init/template/helm/subcharts/content-deployment/templates/secret.yaml +10 -0
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-account.yaml +4 -0
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-binding.yaml +28 -0
- package/lib/init/template/helm/subcharts/content-deployment/values-lint.yaml +5 -0
- package/lib/init/template/helm/subcharts/content-deployment/values.md +1014 -0
- package/lib/init/template/helm/subcharts/content-deployment/values.schema.json +589 -0
- package/lib/init/template/helm/subcharts/content-deployment/values.yaml +54 -0
- package/lib/init/template/helm/{subchart → subcharts/web-application}/Chart.yaml +0 -0
- package/lib/init/template/helm/{subchart → subcharts/web-application}/templates/_helpers.tpl +56 -50
- package/lib/init/template/helm/{subchart → subcharts/web-application}/templates/api-rule.yaml +1 -1
- package/lib/init/template/helm/{subchart → subcharts/web-application}/templates/deployment.yaml +15 -9
- package/lib/init/template/helm/{subchart → subcharts/web-application}/templates/network-policy.yaml +0 -0
- package/lib/init/template/helm/{subchart → subcharts/web-application}/templates/pod-disruption-budget.yaml +2 -2
- package/lib/init/template/helm/{subchart → subcharts/web-application}/templates/secret.yaml +0 -0
- package/lib/init/template/helm/subcharts/web-application/templates/service-account.yaml +6 -0
- package/lib/init/template/helm/{subchart → subcharts/web-application}/templates/service-binding.yaml +4 -3
- package/lib/init/template/helm/{subchart → subcharts/web-application}/templates/service.yaml +0 -0
- package/lib/init/template/helm/subcharts/web-application/templating.md +44 -0
- package/lib/init/template/helm/{subchart → subcharts/web-application}/values-lint.yaml +0 -0
- package/lib/init/template/helm/{subchart → subcharts/web-application}/values.md +254 -200
- package/lib/init/template/helm/{subchart → subcharts/web-application}/values.schema.json +82 -28
- package/lib/init/template/helm/{subchart → subcharts/web-application}/values.yaml +15 -5
- package/lib/init/template/html5-repo/files/chart.yaml +4 -0
- package/lib/init/template/html5-repo/files/html5-apps-deployer-configmap.yaml +14 -0
- package/lib/init/template/html5-repo/index.js +39 -7
- package/lib/init/template/kibana-logging/index.js +1 -1
- package/lib/init/template/lint/index.js +1 -1
- package/lib/init/template/multitenancy/files/saas-registry.yaml +2 -2
- package/lib/init/template/multitenancy/files/service-manager.yaml +1 -0
- package/lib/init/template/multitenancy/files/values.yaml.hbs +10 -6
- package/lib/init/template/multitenancy/index.js +21 -3
- package/lib/init/util/commandUtil.js +5 -5
- package/lib/init/util/merge.js +27 -1
- package/lib/init/util/mvnArchetypeUtil.js +1 -1
- package/lib/init/util/projectReader.js +2 -2
- package/lib/util/exec.js +3 -3
- package/lib/util/term.js +7 -7
- package/lib/watch/livereload-connect.js +187 -0
- package/lib/watch/livereload-server.js +12 -12
- package/lib/watch/node-watch.js +1 -1
- package/npm-shrinkwrap.json +191 -404
- package/package.json +2 -5
- package/lib/init/template/hana/files/hana-deployer-job.yaml +0 -49
- package/lib/init/template/html5-repo/files/_html5_deployment_helpers.tpl +0 -16
- package/lib/init/template/html5-repo/files/html5-apps-deployer-job.yaml +0 -61
- package/lib/init/util/spinner.js +0 -80
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
{{- $ := merge (dict "name" "approuter" "deployment" $deployment) . }}
|
|
5
5
|
{{- $approuterUrl := (include "cap.deploymentHostFull" $ )}}
|
|
6
6
|
|
|
7
|
+
|
|
8
|
+
{{- $defaultParameters := dict "forwardAuthToken" true }}
|
|
9
|
+
{{- $destinations := dict "root" . "defaultParameters" $defaultParameters }}
|
|
10
|
+
|
|
7
11
|
apiVersion: v1
|
|
8
12
|
kind: ConfigMap
|
|
9
13
|
metadata:
|
|
@@ -11,5 +15,5 @@ metadata:
|
|
|
11
15
|
namespace: "{{ .Release.Namespace }}"
|
|
12
16
|
data:
|
|
13
17
|
destinations: >
|
|
14
|
-
{{ include "cap.
|
|
18
|
+
{{ include "cap.backendDestinations" $destinations }}
|
|
15
19
|
TENANT_HOST_PATTERN: {{ printf "^(.*)-%s" $approuterUrl }}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"authenticationMethod": "route",
|
|
3
3
|
"routes": [
|
|
4
|
-
{{#cap.
|
|
4
|
+
{{#cap.isExtensible}}
|
|
5
5
|
{
|
|
6
6
|
"source": "^/-/cds/.*",
|
|
7
7
|
"destination": "mtx-api",
|
|
8
8
|
"authenticationType": "none"
|
|
9
9
|
},
|
|
10
|
-
{{/cap.
|
|
10
|
+
{{/cap.isExtensible}}
|
|
11
11
|
{
|
|
12
12
|
"source": "^/app/(.*)$",
|
|
13
13
|
"target": "$1",
|
|
@@ -35,7 +35,7 @@ module.exports = class ApprouterTemplate extends require('../templateBase') {
|
|
|
35
35
|
await mergeJSON(appPackageJSONPath, join(__dirname, 'files', 'package.json'))
|
|
36
36
|
await sortDependencies(appPackageJSONPath)
|
|
37
37
|
|
|
38
|
-
await mergeJSON(
|
|
38
|
+
await mergeJSON(join(appPath, 'default-env.json'), join(__dirname, 'files', 'default-env.json'))
|
|
39
39
|
|
|
40
40
|
const projectType = await this.getProjectType()
|
|
41
41
|
switch (projectType) {
|
|
@@ -69,7 +69,7 @@ module.exports = class ApprouterTemplate extends require('../templateBase') {
|
|
|
69
69
|
if (isJava && isMultitenant) apis.push(requiredMtxAPI)
|
|
70
70
|
const additions = [srv, approuter, xsuaa, ...apis]
|
|
71
71
|
const mtaYAMLPath = join(this.projectPath, 'mta.yaml')
|
|
72
|
-
await mergeYAML(mtaYAMLPath,
|
|
72
|
+
await mergeYAML(mtaYAMLPath, join(__dirname, 'files', 'mta.yaml.hbs'), projectDescriptor, {
|
|
73
73
|
additions,
|
|
74
74
|
relationships: [{
|
|
75
75
|
insert: [xsuaa, 'name'],
|
|
@@ -115,8 +115,7 @@ module.exports = class ApprouterTemplate extends require('../templateBase') {
|
|
|
115
115
|
envFrom: [
|
|
116
116
|
{
|
|
117
117
|
configMapRef: {
|
|
118
|
-
name: "{{ .Release.Name }}-approuter-configmap"
|
|
119
|
-
tpl: true
|
|
118
|
+
name: "{{ .Release.Name }}-approuter-configmap"
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
]
|
|
@@ -140,6 +139,6 @@ module.exports = class ApprouterTemplate extends require('../templateBase') {
|
|
|
140
139
|
const appPath = join(this.projectPath, projectDescriptor.ui.appPath || 'app')
|
|
141
140
|
const additions = isExtensible && isJava ? [{ ...approuterExtensibilityJava, at: 0 }] :
|
|
142
141
|
isExtensible && isNodejs ? [{ ...approuterExtensibility, at: 0 }] : []
|
|
143
|
-
await mergeJSON(
|
|
142
|
+
await mergeJSON(join(appPath, 'xs-app.json'), join(__dirname, 'files', 'xs-app.json.hbs'), projectDescriptor, { additions })
|
|
144
143
|
}
|
|
145
144
|
}
|
|
@@ -27,7 +27,7 @@ module.exports = class AuditlogTemplate extends require('../templateBase') {
|
|
|
27
27
|
const srv = isNodejs ? srvNode : srvJava
|
|
28
28
|
await mergeYAML(
|
|
29
29
|
mtaYAMLPath,
|
|
30
|
-
|
|
30
|
+
join(__dirname, 'files', 'mta.yaml.hbs'),
|
|
31
31
|
projectDescriptor,
|
|
32
32
|
{
|
|
33
33
|
additions: [srv, auditlog],
|
|
@@ -3,7 +3,7 @@ const cds = require('../../../cds')
|
|
|
3
3
|
const { exists, fs } = cds.utils
|
|
4
4
|
const { resolve, join, relative } = require('path');
|
|
5
5
|
const LOG = console
|
|
6
|
-
const DEBUG = /\
|
|
6
|
+
const DEBUG = /\b(y|all|cli)\b/.test(process.env.DEBUG) && console.debug
|
|
7
7
|
|
|
8
8
|
module.exports = class DataTemplate extends require('../templateBase') {
|
|
9
9
|
constructor(projectPath, generator) {
|
|
@@ -34,7 +34,7 @@ module.exports = class DestinationsTemplate extends require('../templateBase') {
|
|
|
34
34
|
if (hasHelm) {
|
|
35
35
|
//const env = await this.getEnv()
|
|
36
36
|
const binding = hasDestination && { srv: { bindings: { destination: { serviceInstanceName: 'destinations' }}}}
|
|
37
|
-
const html5Binding = hasHtml5Repo && {
|
|
37
|
+
const html5Binding = hasHtml5Repo && { 'html5-apps-deployer': { bindings: { destination: { serviceInstanceName: 'destination' }}}}
|
|
38
38
|
|
|
39
39
|
//in case facet is being added to the already exisiting charts folder
|
|
40
40
|
let isIndependentCommand = false
|
|
@@ -34,7 +34,7 @@ module.exports = class EnterpriseMessagingTemplate extends require('../templateB
|
|
|
34
34
|
const srv = isNodejs ? srvNode : srvJava
|
|
35
35
|
await mergeYAML(
|
|
36
36
|
mtaYAMLPath,
|
|
37
|
-
|
|
37
|
+
join(__dirname, 'files', 'mta.yaml.hbs'),
|
|
38
38
|
projectDescriptor,
|
|
39
39
|
{
|
|
40
40
|
additions: [srv, enterpriseMessaging],
|
|
@@ -24,7 +24,7 @@ module.exports = class ExtensibilityTemplate extends require('../templateBase')
|
|
|
24
24
|
|
|
25
25
|
async runDependentMerging(context = {}) {
|
|
26
26
|
const projectDescriptor = await this.projectReader.read()
|
|
27
|
-
const { hasXsuaa, hasHelm } = projectDescriptor.cap
|
|
27
|
+
const { hasXsuaa, hasHelm, hasApprouter } = projectDescriptor.cap
|
|
28
28
|
if (hasXsuaa) {
|
|
29
29
|
await mergeJSON(
|
|
30
30
|
join(this.projectPath, 'xs-security.json'),
|
|
@@ -47,6 +47,11 @@ module.exports = class ExtensibilityTemplate extends require('../templateBase')
|
|
|
47
47
|
}
|
|
48
48
|
)
|
|
49
49
|
}
|
|
50
|
+
if (hasApprouter) {
|
|
51
|
+
const ApprouterTemplate = require(`../approuter`)
|
|
52
|
+
const approuterTemplate = new ApprouterTemplate(this.projectPath, this.generator)
|
|
53
|
+
await approuterTemplate.runDependentMerging()
|
|
54
|
+
}
|
|
50
55
|
if (hasXsuaa && hasHelm) {
|
|
51
56
|
//in case facet is being added to the already exisiting charts folder
|
|
52
57
|
let isIndependentCommand = false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{- include "cap.service-instance" . }}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
srv:
|
|
3
3
|
bindings:
|
|
4
4
|
db:
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
serviceInstanceName: hana
|
|
6
|
+
hana-deployer:
|
|
7
7
|
image:
|
|
8
8
|
repository: <your-container-registry>/{{cap.appName}}-hana-deployer
|
|
9
9
|
tag: latest
|
|
10
10
|
bindings:
|
|
11
11
|
hana:
|
|
12
|
-
|
|
12
|
+
serviceInstanceName: hana
|
|
13
13
|
resources:
|
|
14
14
|
limits:
|
|
15
15
|
cpu: 2000m
|
|
@@ -17,3 +17,6 @@ hana_deployer:
|
|
|
17
17
|
requests:
|
|
18
18
|
cpu: 1000m
|
|
19
19
|
memory: 1G
|
|
20
|
+
hana:
|
|
21
|
+
serviceOfferingName: hana
|
|
22
|
+
servicePlanName: hdi-shared
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const { join } = require('path');
|
|
2
2
|
const cds = require('../../../cds')
|
|
3
|
-
const { read, write, exists, rm } = cds.utils
|
|
3
|
+
const { read, write, exists, rm, rmdir } = cds.utils
|
|
4
4
|
const commandUtil = require('../../util/commandUtil');
|
|
5
5
|
const mvnArchetypes = require('../../util/mvnArchetypeUtil');
|
|
6
6
|
const term = require('../../../util/term');
|
|
7
|
-
const { mergeJSON, mergeYAML, removeFromYAML } = require('../../util/merge')
|
|
7
|
+
const { mergeJSON, mergeYAML, removeFromYAML, removeFromYAMLArray } = require('../../util/merge')
|
|
8
8
|
const { copyAndTrack, parseMd5File, writeMd5File } = require('../../util/md5Tracking')
|
|
9
9
|
const { copyFiles } = require('../../util/templateUtil')
|
|
10
10
|
const ProjectReader = require('../../util/projectReader');
|
|
@@ -60,10 +60,35 @@ module.exports = class HanaTemplate extends require('../templateBase') {
|
|
|
60
60
|
await this.runDependentMerging()
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
async removeEntriesFromContext(context, key, pattern = false) {
|
|
64
|
+
if(pattern) {
|
|
65
|
+
Object.keys(context.oldTrackingData).forEach(fileName => {
|
|
66
|
+
if (fileName.startsWith(key)) {
|
|
67
|
+
delete context.oldTrackingData[fileName];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
63
70
|
|
|
71
|
+
Object.keys(context.newTrackingData).forEach(fileName => {
|
|
72
|
+
if (fileName.startsWith(key)) {
|
|
73
|
+
delete context.newTrackingData[fileName];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
} else {
|
|
77
|
+
// remove entry from oldTrackingData
|
|
78
|
+
if(context.oldTrackingData !== undefined && context.oldTrackingData[key] !== undefined) {
|
|
79
|
+
delete context.oldTrackingData[key];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// remove entry from newTrackingData
|
|
83
|
+
if(context.newTrackingData !== undefined && context.newTrackingData[key] !== undefined) {
|
|
84
|
+
delete context.newTrackingData[key];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
64
89
|
async runDependentMerging(context = {}) {
|
|
65
90
|
const projectDescriptor = await this.projectReader.read(this.options)
|
|
66
|
-
const { hasMta, hasHelm, isNodejs, isJava, isMultitenant } = projectDescriptor.cap
|
|
91
|
+
const { hasMta, hasHelm, hasHtml5Repo, isNodejs, isJava, isMultitenant } = projectDescriptor.cap
|
|
67
92
|
|
|
68
93
|
if (isMultitenant) {
|
|
69
94
|
await this._updateCdsConfiguration()
|
|
@@ -128,37 +153,64 @@ module.exports = class HanaTemplate extends require('../templateBase') {
|
|
|
128
153
|
|
|
129
154
|
if(isMultitenant){
|
|
130
155
|
shouldUpdateTrackingFile = true;
|
|
131
|
-
const key = "templates/hana-deployer-job.yaml";
|
|
132
156
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
delete context.oldTrackingData[key];
|
|
136
|
-
}
|
|
157
|
+
const instanceTemplateKey = "templates/hana.yaml";
|
|
158
|
+
await this.removeEntriesFromContext(context, instanceTemplateKey);
|
|
137
159
|
|
|
138
|
-
// remove entry from newTrackingData
|
|
139
|
-
if(context.newTrackingData !== undefined && context.newTrackingData[key] !== undefined) {
|
|
140
|
-
delete context.newTrackingData[key];
|
|
141
|
-
}
|
|
142
|
-
|
|
143
160
|
// remove hana entries from values.yaml
|
|
144
|
-
await removeFromYAML(join(this.projectPath, 'chart', 'values.yaml'), ['
|
|
161
|
+
await removeFromYAML(join(this.projectPath, 'chart', 'values.yaml'), ['hana-deployer', 'srv.bindings.db', 'hana']);
|
|
162
|
+
|
|
163
|
+
// remove hana entries from Chart.yaml
|
|
164
|
+
await removeFromYAMLArray(join(this.projectPath, 'chart', 'Chart.yaml'), 'dependencies', 'hana-deployer');
|
|
145
165
|
|
|
146
|
-
|
|
147
|
-
if(
|
|
148
|
-
|
|
166
|
+
// remove content-deployment subchart if html5Repo doesn't exist
|
|
167
|
+
if(!hasHtml5Repo) {
|
|
168
|
+
const contentDeploymentEntriesPattern = "charts/content-deployment/"
|
|
169
|
+
await this.removeEntriesFromContext(context, contentDeploymentEntriesPattern, true);
|
|
170
|
+
|
|
171
|
+
const contentDeploymentSubchartPath = join(this.projectPath, 'chart', 'charts', 'content-deployment');
|
|
172
|
+
if(exists(contentDeploymentSubchartPath)) {
|
|
173
|
+
await rmdir(contentDeploymentSubchartPath);
|
|
174
|
+
}
|
|
149
175
|
}
|
|
150
|
-
|
|
151
|
-
|
|
176
|
+
|
|
177
|
+
const hanaInstanceTemplatePath = join(this.projectPath, 'chart', 'templates', 'hana.yaml');
|
|
178
|
+
if(exists(hanaInstanceTemplatePath)) {
|
|
179
|
+
await rm(hanaInstanceTemplatePath);
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
152
182
|
await mergeYAML(
|
|
153
183
|
join(this.projectPath, 'chart', 'values.yaml'),
|
|
154
184
|
join(__dirname, 'files', 'values.yaml.hbs'),
|
|
155
185
|
projectDescriptor
|
|
156
186
|
)
|
|
157
187
|
await copyAndTrack(
|
|
158
|
-
join(__dirname, 'files', 'hana
|
|
159
|
-
join(this.projectPath, 'chart', 'templates', 'hana
|
|
188
|
+
join(__dirname, 'files', 'hana.yaml'),
|
|
189
|
+
join(this.projectPath, 'chart', 'templates', 'hana.yaml'),
|
|
160
190
|
context
|
|
161
191
|
)
|
|
192
|
+
|
|
193
|
+
// copy content deployment chart if it is not present
|
|
194
|
+
const contentDeploymentSubchartPath = join(this.projectPath, 'chart', 'charts', 'content-deployment');
|
|
195
|
+
if(!exists(contentDeploymentSubchartPath)) {
|
|
196
|
+
const contentDeploymentResourcePath = join(__dirname, '..', 'helm', 'subcharts', 'content-deployment');
|
|
197
|
+
await copyAndTrack(contentDeploymentResourcePath, contentDeploymentSubchartPath, context);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// add dependency entry in chart.yaml
|
|
201
|
+
await mergeYAML(
|
|
202
|
+
join(this.projectPath, 'chart', 'Chart.yaml'),
|
|
203
|
+
join(__dirname, 'files', 'chart.yaml'),
|
|
204
|
+
projectDescriptor,
|
|
205
|
+
{ additions: [{
|
|
206
|
+
ref: `content-deployment-hana-deployer`,
|
|
207
|
+
in: `dependencies`,
|
|
208
|
+
where: [{
|
|
209
|
+
property: 'alias',
|
|
210
|
+
isEqualTo: 'hana-deployer'
|
|
211
|
+
}]
|
|
212
|
+
}]}
|
|
213
|
+
)
|
|
162
214
|
}
|
|
163
215
|
if(shouldUpdateTrackingFile) await writeMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'), context.newTrackingData);
|
|
164
216
|
}
|
|
@@ -69,16 +69,24 @@ Get FQDN of a deployment
|
|
|
69
69
|
{{/*
|
|
70
70
|
Backend Destinations
|
|
71
71
|
*/}}
|
|
72
|
-
{{- define "cap.
|
|
72
|
+
{{- define "cap.backendDestinations" -}}
|
|
73
73
|
{{- $ := . -}}
|
|
74
|
-
{{-
|
|
74
|
+
{{- $root := $.root -}}
|
|
75
|
+
{{- $nameKey := "name" -}}
|
|
76
|
+
{{- $urlKey := "url" -}}
|
|
77
|
+
{{- if $root.Values.backendDestinations }}
|
|
75
78
|
{{- $destinations := list -}}
|
|
76
|
-
{{-
|
|
79
|
+
{{- if $.html5 }}
|
|
80
|
+
{{- $nameKey = "Name" -}}
|
|
81
|
+
{{- $urlKey = "URL" -}}
|
|
82
|
+
{{- end -}}
|
|
83
|
+
{{- range $destinationName, $destination := $root.Values.backendDestinations -}}
|
|
77
84
|
{{- $destination := merge (dict "name" $destinationName) $destination -}}
|
|
78
|
-
{{- $deployment := (get
|
|
79
|
-
{{- $srv := merge (dict "name" $destination.service "destination" $destination "deployment" $deployment) $ -}}
|
|
85
|
+
{{- $deployment := (get $root.Values $destination.service) -}}
|
|
86
|
+
{{- $srv := merge (dict "name" $destination.service "destination" $destination "deployment" $deployment) $root -}}
|
|
80
87
|
{{- $destinationHost := include "cap.deploymentHostFull" $srv -}}
|
|
81
|
-
{{- $currentDestination := dict
|
|
88
|
+
{{- $currentDestination := dict $nameKey $destination.name $urlKey (print "https://" $destinationHost ) -}}
|
|
89
|
+
{{- $currentDestination := merge $currentDestination $.defaultParameters -}}
|
|
82
90
|
{{- $destinations = (append $destinations $currentDestination) -}}
|
|
83
91
|
{{- end -}}
|
|
84
92
|
{{- $destinations | toJson }}
|
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
"$id": "#/properties/approuter",
|
|
12
12
|
"description": "Deployment",
|
|
13
13
|
"$ref": "./charts/web-application/values.schema.json"
|
|
14
|
+
},
|
|
15
|
+
"hana-deployer": {
|
|
16
|
+
"$id": "#/properties/hana-deployer",
|
|
17
|
+
"description": "Content Deployment",
|
|
18
|
+
"$ref": "./charts/content-deployment/values.schema.json"
|
|
19
|
+
},
|
|
20
|
+
"html5-apps-deployer": {
|
|
21
|
+
"$id": "#/properties/html5-apps-deployer",
|
|
22
|
+
"description": "Content Deployment",
|
|
23
|
+
"$ref": "./charts/content-deployment/values.schema.json"
|
|
14
24
|
}
|
|
15
25
|
}
|
|
16
26
|
}
|
|
@@ -42,13 +42,21 @@
|
|
|
42
42
|
"$id": "#/properties/srv",
|
|
43
43
|
"description": "Deployment"
|
|
44
44
|
},
|
|
45
|
+
"hana-deployer": {
|
|
46
|
+
"$id": "#/properties/hana-deployer",
|
|
47
|
+
"description": "Content Deployment"
|
|
48
|
+
},
|
|
49
|
+
"html5-apps-deployer": {
|
|
50
|
+
"$id": "#/properties/html5-apps-deployer",
|
|
51
|
+
"description": "Content Deployment"
|
|
52
|
+
},
|
|
45
53
|
"approuter": {
|
|
46
54
|
"$id": "#/properties/approuter",
|
|
47
55
|
"description": "Deployment"
|
|
48
56
|
},
|
|
49
|
-
"
|
|
50
|
-
"$id": "#/properties/
|
|
51
|
-
"title": "Backend Destinations for Approuter",
|
|
57
|
+
"backendDestinations": {
|
|
58
|
+
"$id": "#/properties/backendDestinations",
|
|
59
|
+
"title": "Backend Destinations for Approuter or HTML5 Apps Deployer",
|
|
52
60
|
"type": "object",
|
|
53
61
|
"patternProperties": {
|
|
54
62
|
"^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
|
|
@@ -130,113 +138,6 @@
|
|
|
130
138
|
"$id": "#/properties/event_mesh",
|
|
131
139
|
"$ref": "#/definitions/ServiceInstance"
|
|
132
140
|
},
|
|
133
|
-
"hana_deployer": {
|
|
134
|
-
"$id": "#/properties/hana_deployer",
|
|
135
|
-
"type": "object",
|
|
136
|
-
"additionalProperties": false,
|
|
137
|
-
"required": [
|
|
138
|
-
"image",
|
|
139
|
-
"bindings",
|
|
140
|
-
"resources"
|
|
141
|
-
],
|
|
142
|
-
"properties": {
|
|
143
|
-
"image": {
|
|
144
|
-
"$id": "#/properties/hana_deployer/image",
|
|
145
|
-
"$ref": "#/definitions/Image"
|
|
146
|
-
},
|
|
147
|
-
"bindings": {
|
|
148
|
-
"$id": "#/properties/hana_deployer/bindings",
|
|
149
|
-
"$ref": "#/definitions/Bindings"
|
|
150
|
-
},
|
|
151
|
-
"resources": {
|
|
152
|
-
"$id": "#/properties/hana_deployer/resources",
|
|
153
|
-
"$ref": "#/definitions/Resources"
|
|
154
|
-
},
|
|
155
|
-
"env": {
|
|
156
|
-
"$id": "#/properties/hana_deployer/env",
|
|
157
|
-
"description": "Key-value map of environment variables, which should be added to the Pod spec.",
|
|
158
|
-
"type": "object",
|
|
159
|
-
"patternProperties": {
|
|
160
|
-
"^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
|
|
161
|
-
"$comment": "regex above copied from https://github.com/kubernetes/kubernetes/blob/ea0764452222146c47ec826977f49d7001b0ea8c/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L402",
|
|
162
|
-
"not": {
|
|
163
|
-
"type": ["null", "object", "array"]
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
"additionalProperties": false,
|
|
168
|
-
"default": {}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
"html5_apps_deployer": {
|
|
173
|
-
"$id": "#/properties/html5_apps_deployer",
|
|
174
|
-
"type": "object",
|
|
175
|
-
"additionalProperties": false,
|
|
176
|
-
"required": [
|
|
177
|
-
"image",
|
|
178
|
-
"bindings",
|
|
179
|
-
"resources",
|
|
180
|
-
"cloudService"
|
|
181
|
-
],
|
|
182
|
-
"properties": {
|
|
183
|
-
"image": {
|
|
184
|
-
"$id": "#/properties/html5_apps_deployer/image",
|
|
185
|
-
"$ref": "#/definitions/Image"
|
|
186
|
-
},
|
|
187
|
-
"bindings": {
|
|
188
|
-
"$id": "#/properties/html5_apps_deployer/bindings",
|
|
189
|
-
"$ref": "#/definitions/Bindings"
|
|
190
|
-
},
|
|
191
|
-
"resources": {
|
|
192
|
-
"$id": "#/properties/html5_apps_deployer/resources",
|
|
193
|
-
"$ref": "#/definitions/Resources"
|
|
194
|
-
},
|
|
195
|
-
"env": {
|
|
196
|
-
"$id": "#/properties/html5_apps_deployer/env",
|
|
197
|
-
"description": "Key-value map of environment variables, which should be added to the Pod spec.",
|
|
198
|
-
"type": "object",
|
|
199
|
-
"patternProperties": {
|
|
200
|
-
"^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
|
|
201
|
-
"$comment": "regex above copied from https://github.com/kubernetes/kubernetes/blob/ea0764452222146c47ec826977f49d7001b0ea8c/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L402",
|
|
202
|
-
"not": {
|
|
203
|
-
"type": ["null", "object", "array"]
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
"additionalProperties": false,
|
|
208
|
-
"default": {}
|
|
209
|
-
},
|
|
210
|
-
"backendDestinations": {
|
|
211
|
-
"$id": "#/properties/html5_apps_deployer/backendDestinations",
|
|
212
|
-
"title": "Backend Destinations for HTML5 Application",
|
|
213
|
-
"type": "object",
|
|
214
|
-
"patternProperties": {
|
|
215
|
-
"^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
|
|
216
|
-
"description": "Name of the backend Destination",
|
|
217
|
-
"required": [
|
|
218
|
-
"service"
|
|
219
|
-
],
|
|
220
|
-
"properties": {
|
|
221
|
-
"service": {
|
|
222
|
-
"type": "string",
|
|
223
|
-
"description": "Target Kubernetes service"
|
|
224
|
-
},
|
|
225
|
-
"path": {
|
|
226
|
-
"type": "string",
|
|
227
|
-
"description": "This path will be appended to the URL"
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
"cloudService": {
|
|
234
|
-
"$id": "#/properties/html5_apps_deployer/cloudService",
|
|
235
|
-
"type": "string",
|
|
236
|
-
"description": "Name for your business service (unique per subaccount)"
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
141
|
"html5_apps_repo_host": {
|
|
241
142
|
"$id": "#/properties/html5_apps_repo_host",
|
|
242
143
|
"$ref": "#/definitions/ServiceInstance"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { join } = require('path');
|
|
2
|
-
const { exists,
|
|
2
|
+
const { exists, rimraf } = require('../../../cds').utils;
|
|
3
3
|
const ProjectReader = require('../../util/projectReader');
|
|
4
4
|
const { mergeYAML } = require('../../util/merge')
|
|
5
5
|
const { parseMd5File, writeMd5File, copyAndTrack } = require('../../util/md5Tracking')
|
|
@@ -32,7 +32,7 @@ module.exports = class HelmTemplate extends require('../templateBase') {
|
|
|
32
32
|
this.oldTrackingData = await parseMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'));
|
|
33
33
|
|
|
34
34
|
await copyAndTrack(
|
|
35
|
-
join(__dirname, '
|
|
35
|
+
join(__dirname, 'subcharts', 'web-application'),
|
|
36
36
|
join(this.projectPath, 'chart', 'charts', 'web-application'),
|
|
37
37
|
this
|
|
38
38
|
)
|