@sap/cds-dk 6.5.2 → 6.6.1
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 +40 -0
- package/bin/activate.js +7 -0
- package/bin/add.js +1 -2
- package/bin/build/all.js +14 -9
- package/bin/cds.js +11 -8
- package/bin/compile/index.js +13 -3
- package/bin/env.js +16 -25
- package/bin/extend.js +8 -0
- package/bin/init.js +0 -3
- package/bin/login.js +3 -7
- package/bin/logout.js +2 -7
- package/bin/watch.js +4 -5
- package/lib/client/activate.js +1 -1
- package/lib/client/helper/errors.js +4 -1
- package/lib/client/params.js +4 -3
- package/lib/client/pull.js +31 -5
- package/lib/client/push.js +3 -3
- package/lib/client/settings_manager.js +6 -6
- package/lib/client/subscription.js +1 -1
- package/lib/compile/asyncapi/channels.js +22 -0
- package/lib/compile/asyncapi/components/messageTraits/index.js +89 -0
- package/lib/compile/asyncapi/components/messages/index.js +150 -0
- package/lib/compile/asyncapi/components/schemas/annotations.js +13 -0
- package/lib/compile/asyncapi/components/schemas/array.js +8 -0
- package/lib/compile/asyncapi/components/schemas/cache.js +14 -0
- package/lib/compile/asyncapi/components/schemas/definition.js +187 -0
- package/lib/compile/asyncapi/components/schemas/enum.js +16 -0
- package/lib/compile/asyncapi/components/schemas/examples.js +10 -0
- package/lib/compile/asyncapi/components/schemas/index.js +14 -0
- package/lib/compile/asyncapi/components/schemas/localized.js +29 -0
- package/lib/compile/asyncapi/components/schemas/primitiveElement.js +41 -0
- package/lib/compile/asyncapi/components/schemas/ref.js +45 -0
- package/lib/compile/asyncapi/components/schemas/utils.js +108 -0
- package/lib/compile/asyncapi/index.js +226 -0
- package/lib/compile/asyncapi/message.js +13 -0
- package/lib/compile/asyncapi/utils.js +27 -0
- package/lib/compile/index.js +1 -0
- package/lib/compile/openapi/csdl2openapi.js +42 -18
- package/lib/import/message.js +4 -1
- package/lib/import/odata/metadataconverter/MetadataConverter.js +8 -3
- package/lib/import/odata/v2parser.js +131 -50
- package/lib/import/odata/v4parser.js +292 -112
- package/lib/import/openapi/importOpenAPI.js +14 -14
- package/lib/init/constants.js +1 -1
- package/lib/init/index.js +11 -21
- package/lib/init/template/_merging/registry-mta.js +15 -26
- package/lib/init/template/approuter/files/package.json +2 -2
- package/lib/init/template/approuter/index.js +6 -12
- package/lib/init/template/auditlog/files/auditlog.yaml +4 -1
- package/lib/init/template/auditlog/index.js +23 -8
- package/lib/init/template/cf-manifest/index.js +4 -14
- package/lib/init/template/connectivity/files/connectivity-proxy-info.yaml +2 -6
- package/lib/init/template/connectivity/files/values.yaml.hbs +5 -8
- package/lib/init/template/connectivity/index.js +2 -9
- package/lib/init/template/data/index.js +0 -4
- package/lib/init/template/destinations/files/destination.yaml +4 -1
- package/lib/init/template/destinations/index.js +25 -10
- package/lib/init/template/enterprise-messaging/files/event-mesh.yaml +4 -1
- package/lib/init/template/enterprise-messaging/files/values.yaml +1 -2
- package/lib/init/template/enterprise-messaging/index.js +28 -20
- package/lib/init/template/extensibility/index.js +23 -31
- package/lib/init/template/hana/files/hana.yaml +4 -1
- package/lib/init/template/hana/index.js +44 -24
- package/lib/init/template/helm/chart/templates/_helpers.tpl +12 -0
- package/lib/init/template/helm/chart/values.root.schema.json +40 -0
- package/lib/init/template/helm/chart/values.schema.json +32 -69
- package/lib/init/template/helm/index.js +26 -16
- package/lib/init/template/helm/subcharts/content-deployment/templates/_helpers.tpl +13 -26
- package/lib/init/template/helm/subcharts/content-deployment/templates/job.yaml +3 -3
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-account.yaml +2 -0
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-binding.yaml +3 -3
- package/lib/init/template/helm/subcharts/content-deployment/templating.md +37 -0
- package/lib/init/template/helm/subcharts/content-deployment/values.md +182 -185
- package/lib/init/template/helm/subcharts/content-deployment/values.schema.json +18 -22
- package/lib/init/template/helm/subcharts/content-deployment/values.yaml +2 -0
- package/lib/init/template/helm/subcharts/service-instance/Chart.yaml +5 -0
- package/lib/init/template/helm/subcharts/service-instance/templates/_helpers.tpl +65 -0
- package/lib/init/template/helm/subcharts/service-instance/templates/serviceinstance.yaml +23 -0
- package/lib/init/template/helm/subcharts/service-instance/templating.md +18 -0
- package/lib/init/template/helm/subcharts/service-instance/values-lint.yaml +2 -0
- package/lib/init/template/helm/subcharts/service-instance/values.md +186 -0
- package/lib/init/template/helm/subcharts/service-instance/values.schema.json +102 -0
- package/lib/init/template/helm/subcharts/service-instance/values.yaml +15 -0
- package/lib/init/template/html5-repo/files/html5-apps-deployer-configmap.yaml +2 -2
- package/lib/init/template/html5-repo/files/html5-apps-repo-host.yaml +4 -1
- package/lib/init/template/html5-repo/index.js +30 -21
- package/lib/init/template/java/index.js +3 -6
- package/lib/init/template/kibana-logging/index.js +7 -10
- package/lib/init/template/lint/index.js +2 -3
- package/lib/init/template/mta/files/mta.yaml.hbs +4 -2
- package/lib/init/template/mta/index.js +7 -11
- package/lib/init/template/mtx/index.js +0 -5
- package/lib/init/template/multitenancy/files/java/package.json +16 -7
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +11 -3
- package/lib/init/template/multitenancy/files/saas-registry-secret.yaml +9 -0
- package/lib/init/template/multitenancy/files/saas-registry.yaml +4 -17
- package/lib/init/template/multitenancy/files/service-manager.yaml +4 -1
- package/lib/init/template/multitenancy/files/values.yaml.hbs +15 -3
- package/lib/init/template/multitenancy/index.js +56 -31
- package/lib/init/template/nodejs/index.js +4 -7
- package/lib/init/template/notebook/index.js +1 -3
- package/lib/init/template/pipeline/index.js +2 -5
- package/lib/init/template/samples/index.js +6 -11
- package/lib/init/template/templateBase.js +10 -17
- package/lib/init/template/toggles/index.js +2 -6
- package/lib/init/template/xsuaa/files/values.yaml.hbs +0 -1
- package/lib/init/template/xsuaa/files/xsuaa.yaml +4 -1
- package/lib/init/template/xsuaa/index.js +27 -23
- package/lib/init/types.d.ts +0 -81
- package/lib/init/util/merge.js +23 -25
- package/lib/init/util/mvnArchetypeUtil.js +34 -2
- package/lib/init/util/projectReader.js +27 -24
- package/lib/lint/Linter.js +31 -13
- package/lib/watch/livereload-server.js +29 -17
- package/lib/watch/node-watch.js +51 -49
- package/npm-shrinkwrap.json +548 -467
- package/package.json +4 -4
- package/readme.md +5 -0
- package/lib/init/template/connectivity/files/connectivity-binding.yaml +0 -9
- package/lib/init/template/connectivity/files/connectivity.yaml +0 -1
- package/lib/init/template/multitenancy/files/xsuaa.yaml +0 -1
- /package/lib/init/template/hana/files/{chart.yaml → hana-deployer.yaml} +0 -0
- /package/lib/init/template/html5-repo/files/{chart.yaml → html5-apps-deployer.yaml} +0 -0
- /package/lib/init/template/multitenancy/files/{chart.yaml → sidecar.yaml} +0 -0
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
const { join } = require('path')
|
|
2
|
-
const
|
|
2
|
+
const { readProject } = require('../../util/projectReader')
|
|
3
3
|
const { mergeYAML } = require('../../util/merge')
|
|
4
|
-
const {
|
|
4
|
+
const { parseMd5File, writeMd5File } = require('../../util/md5Tracking')
|
|
5
5
|
|
|
6
6
|
module.exports = class DestinationsTemplate extends require('../templateBase') {
|
|
7
|
-
constructor(projectPath, generator) {
|
|
8
|
-
super(projectPath, generator, __dirname)
|
|
9
|
-
this.projectReader = new ProjectReader(projectPath)
|
|
10
|
-
}
|
|
11
7
|
|
|
12
8
|
async canRun() {
|
|
13
|
-
const projectDescriptor = await
|
|
9
|
+
const projectDescriptor = await readProject(this.options)
|
|
14
10
|
const { hasMta, hasHelm } = projectDescriptor.cap
|
|
15
11
|
if (!hasHelm && hasMta) {
|
|
16
12
|
throw `'cds add destinations' is not available for Cloud Foundry yet`
|
|
@@ -28,12 +24,12 @@ module.exports = class DestinationsTemplate extends require('../templateBase') {
|
|
|
28
24
|
}
|
|
29
25
|
|
|
30
26
|
async runDependentMerging(context = {}) {
|
|
31
|
-
const projectDescriptor = await
|
|
27
|
+
const projectDescriptor = await readProject(this.options)
|
|
32
28
|
const { hasHelm, hasDestination, hasHtml5Repo } = projectDescriptor.cap
|
|
33
29
|
|
|
34
30
|
if (hasHelm) {
|
|
35
31
|
//const env = await this.getEnv()
|
|
36
|
-
const binding = hasDestination && { srv: { bindings: { destination: { serviceInstanceName: '
|
|
32
|
+
const binding = hasDestination && { srv: { bindings: { destination: { serviceInstanceName: 'destination' }}}}
|
|
37
33
|
const html5Binding = hasHtml5Repo && { 'html5-apps-deployer': { bindings: { destination: { serviceInstanceName: 'destination' }}}}
|
|
38
34
|
|
|
39
35
|
//in case facet is being added to the already exisiting charts folder
|
|
@@ -58,7 +54,26 @@ module.exports = class DestinationsTemplate extends require('../templateBase') {
|
|
|
58
54
|
}
|
|
59
55
|
}
|
|
60
56
|
)
|
|
61
|
-
|
|
57
|
+
|
|
58
|
+
// copy service instance chart if it is not present
|
|
59
|
+
const HelmTemplate = require(`../helm`);
|
|
60
|
+
const helmTemplate = new HelmTemplate(this.generator, context.oldTrackingData, context.newTrackingData);
|
|
61
|
+
isIndependentCommand = isIndependentCommand | await helmTemplate.addSubChart('service-instance');
|
|
62
|
+
|
|
63
|
+
// add dependency entry in chart.yaml
|
|
64
|
+
await mergeYAML(
|
|
65
|
+
join(this.projectPath, 'chart', 'Chart.yaml'),
|
|
66
|
+
join(__dirname, 'files', 'destination.yaml'),
|
|
67
|
+
projectDescriptor,
|
|
68
|
+
{ additions: [{
|
|
69
|
+
in: `dependencies`,
|
|
70
|
+
where: [{
|
|
71
|
+
property: 'alias',
|
|
72
|
+
isEqualTo: 'destination'
|
|
73
|
+
}]
|
|
74
|
+
}]}
|
|
75
|
+
)
|
|
76
|
+
|
|
62
77
|
if(isIndependentCommand) await writeMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'), context.newTrackingData)
|
|
63
78
|
}
|
|
64
79
|
}
|
|
@@ -1,39 +1,36 @@
|
|
|
1
1
|
const { join } = require('path')
|
|
2
|
-
const
|
|
2
|
+
const { readProject } = require('../../util/projectReader')
|
|
3
3
|
const { mergeJSON, mergeYAML } = require('../../util/merge')
|
|
4
|
-
const {
|
|
4
|
+
const { parseMd5File, writeMd5File } = require('../../util/md5Tracking')
|
|
5
5
|
const { srvNode, srvJava, enterpriseMessaging } = require('../_merging/registry-mta')
|
|
6
6
|
|
|
7
7
|
module.exports = class EnterpriseMessagingTemplate extends require('../templateBase') {
|
|
8
|
-
|
|
9
|
-
super(projectPath, generator, __dirname)
|
|
10
|
-
this.projectReader = new ProjectReader(projectPath)
|
|
11
|
-
}
|
|
8
|
+
|
|
12
9
|
|
|
13
10
|
static hasFacet(env) {
|
|
14
|
-
return env.requires?.messaging === 'enterprise-messaging'
|
|
11
|
+
return env.requires?.messaging?.kind === 'enterprise-messaging-http'
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
async run() {
|
|
18
|
-
const projectDescriptor = await
|
|
15
|
+
const projectDescriptor = await readProject(this.options)
|
|
19
16
|
const { for: forProfile, isNodejs } = projectDescriptor.cap
|
|
20
17
|
const templatePath = join(__dirname, 'files')
|
|
21
18
|
const cdsTemplateFile = (isNodejs ? 'cds.package.json' : 'cdsrc.json') + (forProfile ? '.hbs' : '')
|
|
22
19
|
const cdsTemplatePath = join(templatePath, cdsTemplateFile)
|
|
23
20
|
const configPath = join(this.projectPath, isNodejs ? 'package.json' : '.cdsrc.json')
|
|
24
21
|
await mergeJSON(configPath, cdsTemplatePath, projectDescriptor)
|
|
22
|
+
await mergeJSON('event-mesh.json', join(__dirname, 'files', 'event-mesh.json.hbs'), projectDescriptor)
|
|
25
23
|
await this.runDependentMerging()
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
async runDependentMerging(context = {}) {
|
|
29
|
-
const projectDescriptor = await
|
|
27
|
+
const projectDescriptor = await readProject(this.options)
|
|
30
28
|
const { hasHelm, hasMta, isNodejs } = projectDescriptor.cap
|
|
31
29
|
|
|
32
30
|
if (hasMta) {
|
|
33
|
-
const mtaYAMLPath = join(this.projectPath, 'mta.yaml')
|
|
34
31
|
const srv = isNodejs ? srvNode : srvJava
|
|
35
32
|
await mergeYAML(
|
|
36
|
-
|
|
33
|
+
'mta.yaml',
|
|
37
34
|
join(__dirname, 'files', 'mta.yaml.hbs'),
|
|
38
35
|
projectDescriptor,
|
|
39
36
|
{
|
|
@@ -44,11 +41,6 @@ module.exports = class EnterpriseMessagingTemplate extends require('../templateB
|
|
|
44
41
|
}]
|
|
45
42
|
}
|
|
46
43
|
)
|
|
47
|
-
await mergeJSON(
|
|
48
|
-
join(this.projectPath, 'event-mesh.json'),
|
|
49
|
-
join(__dirname, 'files', 'event-mesh.json.hbs'),
|
|
50
|
-
projectDescriptor
|
|
51
|
-
)
|
|
52
44
|
}
|
|
53
45
|
|
|
54
46
|
if (hasHelm) {
|
|
@@ -59,15 +51,31 @@ module.exports = class EnterpriseMessagingTemplate extends require('../templateB
|
|
|
59
51
|
context.projectPath = this.projectPath
|
|
60
52
|
context.oldTrackingData = context.newTrackingData = await parseMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'))
|
|
61
53
|
}
|
|
54
|
+
|
|
62
55
|
await mergeYAML(
|
|
63
56
|
join(this.projectPath, 'chart', 'values.yaml'),
|
|
64
57
|
join(__dirname, 'files', 'values.yaml')
|
|
65
58
|
)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
|
|
60
|
+
// copy service instance chart if it is not present
|
|
61
|
+
const HelmTemplate = require(`../helm`);
|
|
62
|
+
const helmTemplate = new HelmTemplate(this.generator, context.oldTrackingData, context.newTrackingData);
|
|
63
|
+
isIndependentCommand = isIndependentCommand | await helmTemplate.addSubChart('service-instance');
|
|
64
|
+
|
|
65
|
+
// add dependency entry in chart.yaml
|
|
66
|
+
await mergeYAML(
|
|
67
|
+
join(this.projectPath, 'chart', 'Chart.yaml'),
|
|
68
|
+
join(__dirname, 'files', 'event-mesh.yaml'),
|
|
69
|
+
projectDescriptor,
|
|
70
|
+
{ additions: [{
|
|
71
|
+
in: `dependencies`,
|
|
72
|
+
where: [{
|
|
73
|
+
property: 'alias',
|
|
74
|
+
isEqualTo: 'event-mesh'
|
|
75
|
+
}]
|
|
76
|
+
}]}
|
|
70
77
|
)
|
|
78
|
+
|
|
71
79
|
if(isIndependentCommand) await writeMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'), context.newTrackingData)
|
|
72
80
|
}
|
|
73
81
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
const cds = require('../../../cds')
|
|
2
|
+
const { read, write, exists } = cds.utils
|
|
1
3
|
const { join } = require('path')
|
|
2
|
-
const
|
|
4
|
+
const { readProject } = require('../../util/projectReader')
|
|
3
5
|
const { mergeJSON } = require('../../util/merge')
|
|
4
|
-
const {
|
|
6
|
+
const { OPTION_MULTITENANCY } = require('../../constants')
|
|
5
7
|
|
|
6
8
|
module.exports = class ExtensibilityTemplate extends require('../templateBase') {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
getDependencies() {
|
|
12
|
+
return exists('pom.xml') ? [OPTION_MULTITENANCY] : [] // REVISIT: Remove this dependency
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
static hasFacet(env) {
|
|
@@ -14,33 +17,38 @@ module.exports = class ExtensibilityTemplate extends require('../templateBase')
|
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
async run() {
|
|
17
|
-
const projectDescriptor = await
|
|
18
|
-
const { for: forProfile, isJava } = projectDescriptor.cap
|
|
20
|
+
const projectDescriptor = await readProject(this.options)
|
|
21
|
+
const { for: forProfile, isJava, hasSidecar } = projectDescriptor.cap
|
|
19
22
|
const cdsConfigPath = join(this.projectPath, isJava ? '.cdsrc.json' : 'package.json')
|
|
20
23
|
const cdsTemplateFile = forProfile ? (isJava ? 'cdsrc.json.hbs' : 'cds.package.json.hbs') : (isJava ? 'cdsrc.json' : 'cds.package.json')
|
|
21
24
|
await mergeJSON(cdsConfigPath, join(__dirname, 'files', cdsTemplateFile), projectDescriptor)
|
|
25
|
+
if (hasSidecar) {
|
|
26
|
+
const out = join('mtx', 'sidecar', 'package.json')
|
|
27
|
+
const config = await read(out)
|
|
28
|
+
if (!('cds.xt.ExtensibilityService' in config.cds.requires)) {
|
|
29
|
+
config.cds.requires['cds.xt.ExtensibilityService'] = true
|
|
30
|
+
await write(out, config, { spaces: 2 })
|
|
31
|
+
}
|
|
32
|
+
}
|
|
22
33
|
await this.runDependentMerging()
|
|
23
34
|
}
|
|
24
35
|
|
|
25
|
-
async runDependentMerging(
|
|
26
|
-
const projectDescriptor = await
|
|
27
|
-
const { hasXsuaa,
|
|
36
|
+
async runDependentMerging() {
|
|
37
|
+
const projectDescriptor = await readProject()
|
|
38
|
+
const { hasXsuaa, hasApprouter } = projectDescriptor.cap
|
|
28
39
|
if (hasXsuaa) {
|
|
29
40
|
await mergeJSON(
|
|
30
|
-
|
|
41
|
+
'xs-security.json',
|
|
31
42
|
join(__dirname, 'files', 'xs-security.json.hbs'),
|
|
32
43
|
projectDescriptor,
|
|
33
44
|
{
|
|
34
45
|
additions: [{
|
|
35
|
-
ref: 'scope-extension-developer',
|
|
36
46
|
in: 'scopes',
|
|
37
47
|
where: [{ property: 'name', isEqualTo: '$XSAPPNAME.cds.ExtensionDeveloper' }],
|
|
38
48
|
}, {
|
|
39
|
-
ref: 'scope-uiflex',
|
|
40
49
|
in: 'scopes',
|
|
41
50
|
where: [{ property: 'name', isEqualTo: '$XSAPPNAME.cds.UIFlexDeveloper' }],
|
|
42
51
|
}, {
|
|
43
|
-
ref: 'template-extension-developer',
|
|
44
52
|
in: 'role-templates',
|
|
45
53
|
where: [{ property: 'name', isEqualTo: 'ExtensionDeveloper' }],
|
|
46
54
|
}]
|
|
@@ -49,24 +57,8 @@ module.exports = class ExtensibilityTemplate extends require('../templateBase')
|
|
|
49
57
|
}
|
|
50
58
|
if (hasApprouter) {
|
|
51
59
|
const ApprouterTemplate = require(`../approuter`)
|
|
52
|
-
const approuterTemplate = new ApprouterTemplate(this.
|
|
60
|
+
const approuterTemplate = new ApprouterTemplate(this.generator)
|
|
53
61
|
await approuterTemplate.runDependentMerging()
|
|
54
|
-
}
|
|
55
|
-
if (hasXsuaa && hasHelm) {
|
|
56
|
-
//in case facet is being added to the already exisiting charts folder
|
|
57
|
-
let isIndependentCommand = false
|
|
58
|
-
if(Object.keys(context).length == 0){
|
|
59
|
-
isIndependentCommand = true
|
|
60
|
-
context.projectPath = this.projectPath
|
|
61
|
-
context.oldTrackingData = context.newTrackingData = await parseMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'))
|
|
62
|
-
}
|
|
63
|
-
// REVISIT: Shared xs-security.json location for Helm and MTA?
|
|
64
|
-
await copyAndTrack(
|
|
65
|
-
join(this.projectPath, 'xs-security.json'),
|
|
66
|
-
join(this.projectPath, 'chart', 'xs-security.json'),
|
|
67
|
-
context
|
|
68
|
-
)
|
|
69
|
-
if(isIndependentCommand) await writeMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'), context.newTrackingData)
|
|
70
62
|
}
|
|
71
63
|
}
|
|
72
64
|
}
|
|
@@ -5,9 +5,9 @@ const commandUtil = require('../../util/commandUtil');
|
|
|
5
5
|
const mvnArchetypes = require('../../util/mvnArchetypeUtil');
|
|
6
6
|
const term = require('../../../util/term');
|
|
7
7
|
const { mergeJSON, mergeYAML, removeFromYAML, removeFromYAMLArray } = require('../../util/merge')
|
|
8
|
-
const {
|
|
8
|
+
const { parseMd5File, writeMd5File } = require('../../util/md5Tracking')
|
|
9
9
|
const { copyFiles } = require('../../util/templateUtil')
|
|
10
|
-
const
|
|
10
|
+
const { readProject } = require('../../util/projectReader');
|
|
11
11
|
const versionCompare = require('../../util/versionCompare');
|
|
12
12
|
|
|
13
13
|
const { PROJECT_TYPE, OPTION_JAVA, URLS } = require('../../constants');
|
|
@@ -15,10 +15,6 @@ const { PROJECT_TYPE, OPTION_JAVA, URLS } = require('../../constants');
|
|
|
15
15
|
const { srvNode, srvJava, hdbDeployer, serviceManager, hdiContainer, mtxSidecar } = require('../_merging/registry-mta');
|
|
16
16
|
|
|
17
17
|
module.exports = class HanaTemplate extends require('../templateBase') {
|
|
18
|
-
constructor(projectPath, generator) {
|
|
19
|
-
super(projectPath, generator, __dirname);
|
|
20
|
-
this.projectReader = new ProjectReader(projectPath);
|
|
21
|
-
}
|
|
22
18
|
|
|
23
19
|
static hasFacet(env) {
|
|
24
20
|
return env.requires?.db?.kind === 'hana'
|
|
@@ -43,7 +39,7 @@ module.exports = class HanaTemplate extends require('../templateBase') {
|
|
|
43
39
|
const undeployJSONTemplatePath = join(__dirname, 'files', 'common', 'undeploy.json');
|
|
44
40
|
await mergeJSON(undeployJSONPath, undeployJSONTemplatePath);
|
|
45
41
|
|
|
46
|
-
const projectType =
|
|
42
|
+
const projectType = this.getProjectType();
|
|
47
43
|
switch (projectType) {
|
|
48
44
|
case PROJECT_TYPE.java: {
|
|
49
45
|
await copyFiles(join(__dirname, 'files', 'java', 'db'), join(this.projectPath, env.folders.db), {}, this.options.force);
|
|
@@ -85,9 +81,9 @@ module.exports = class HanaTemplate extends require('../templateBase') {
|
|
|
85
81
|
}
|
|
86
82
|
}
|
|
87
83
|
}
|
|
88
|
-
|
|
84
|
+
|
|
89
85
|
async runDependentMerging(context = {}) {
|
|
90
|
-
const projectDescriptor = await
|
|
86
|
+
const projectDescriptor = await readProject(this.options)
|
|
91
87
|
const { hasMta, hasHelm, hasHtml5Repo, isNodejs, isJava, isMultitenant } = projectDescriptor.cap
|
|
92
88
|
|
|
93
89
|
if (isMultitenant) {
|
|
@@ -136,7 +132,7 @@ module.exports = class HanaTemplate extends require('../templateBase') {
|
|
|
136
132
|
|
|
137
133
|
await mergeYAML(
|
|
138
134
|
mtaYAMLPath,
|
|
139
|
-
|
|
135
|
+
join(__dirname, 'files', 'mta.yaml.hbs'),
|
|
140
136
|
projectDescriptor,
|
|
141
137
|
{ additions: [...modules, db].filter(a => a), deletions, relationships }
|
|
142
138
|
)
|
|
@@ -178,32 +174,39 @@ module.exports = class HanaTemplate extends require('../templateBase') {
|
|
|
178
174
|
if(exists(hanaInstanceTemplatePath)) {
|
|
179
175
|
await rm(hanaInstanceTemplatePath);
|
|
180
176
|
}
|
|
177
|
+
|
|
178
|
+
await mergeYAML(
|
|
179
|
+
join(this.projectPath, 'chart', 'Chart.yaml'),
|
|
180
|
+
join(__dirname, 'files', 'hana.yaml'),
|
|
181
|
+
projectDescriptor,
|
|
182
|
+
{ deletions: [{
|
|
183
|
+
item: {
|
|
184
|
+
in: `dependencies`,
|
|
185
|
+
where: [{
|
|
186
|
+
property: 'alias',
|
|
187
|
+
isEqualTo: 'hana'
|
|
188
|
+
}]
|
|
189
|
+
}
|
|
190
|
+
}]}
|
|
191
|
+
)
|
|
181
192
|
} else {
|
|
182
193
|
await mergeYAML(
|
|
183
194
|
join(this.projectPath, 'chart', 'values.yaml'),
|
|
184
195
|
join(__dirname, 'files', 'values.yaml.hbs'),
|
|
185
196
|
projectDescriptor
|
|
186
197
|
)
|
|
187
|
-
await copyAndTrack(
|
|
188
|
-
join(__dirname, 'files', 'hana.yaml'),
|
|
189
|
-
join(this.projectPath, 'chart', 'templates', 'hana.yaml'),
|
|
190
|
-
context
|
|
191
|
-
)
|
|
192
198
|
|
|
193
199
|
// copy content deployment chart if it is not present
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
await copyAndTrack(contentDeploymentResourcePath, contentDeploymentSubchartPath, context);
|
|
198
|
-
}
|
|
200
|
+
const HelmTemplate = require(`../helm`);
|
|
201
|
+
const helmTemplate = new HelmTemplate(this.generator, context.oldTrackingData, context.newTrackingData);
|
|
202
|
+
shouldUpdateTrackingFile = shouldUpdateTrackingFile | await helmTemplate.addSubChart('content-deployment');
|
|
199
203
|
|
|
200
204
|
// add dependency entry in chart.yaml
|
|
201
205
|
await mergeYAML(
|
|
202
206
|
join(this.projectPath, 'chart', 'Chart.yaml'),
|
|
203
|
-
join(__dirname, 'files', '
|
|
207
|
+
join(__dirname, 'files', 'hana-deployer.yaml'),
|
|
204
208
|
projectDescriptor,
|
|
205
209
|
{ additions: [{
|
|
206
|
-
ref: `content-deployment-hana-deployer`,
|
|
207
210
|
in: `dependencies`,
|
|
208
211
|
where: [{
|
|
209
212
|
property: 'alias',
|
|
@@ -211,6 +214,23 @@ module.exports = class HanaTemplate extends require('../templateBase') {
|
|
|
211
214
|
}]
|
|
212
215
|
}]}
|
|
213
216
|
)
|
|
217
|
+
|
|
218
|
+
// add service instance chart if it is not present
|
|
219
|
+
shouldUpdateTrackingFile = shouldUpdateTrackingFile | await helmTemplate.addSubChart('service-instance');
|
|
220
|
+
|
|
221
|
+
// add dependency entry in chart.yaml
|
|
222
|
+
await mergeYAML(
|
|
223
|
+
join(this.projectPath, 'chart', 'Chart.yaml'),
|
|
224
|
+
join(__dirname, 'files', 'hana.yaml'),
|
|
225
|
+
projectDescriptor,
|
|
226
|
+
{ additions: [{
|
|
227
|
+
in: `dependencies`,
|
|
228
|
+
where: [{
|
|
229
|
+
property: 'alias',
|
|
230
|
+
isEqualTo: 'hana'
|
|
231
|
+
}]
|
|
232
|
+
}]}
|
|
233
|
+
)
|
|
214
234
|
}
|
|
215
235
|
if(shouldUpdateTrackingFile) await writeMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'), context.newTrackingData);
|
|
216
236
|
}
|
|
@@ -248,10 +268,10 @@ module.exports = class HanaTemplate extends require('../templateBase') {
|
|
|
248
268
|
}
|
|
249
269
|
|
|
250
270
|
async _updateCdsConfiguration(configPath) {
|
|
251
|
-
const projectType =
|
|
271
|
+
const projectType = this.getProjectType();
|
|
252
272
|
const configFile = projectType === PROJECT_TYPE.nodejs ? 'package.json' : '.cdsrc.json';
|
|
253
273
|
configPath = configPath ?? join(this.projectPath, configFile)
|
|
254
|
-
const projectDescriptor = await
|
|
274
|
+
const projectDescriptor = await readProject(this.options);
|
|
255
275
|
const { for: forProfile } = projectDescriptor.cap;
|
|
256
276
|
let json; try { json = await read(configPath, 'utf8') } catch { /* ignore */ }
|
|
257
277
|
const _cds = projectType === PROJECT_TYPE.nodejs ? json?.cds : json;
|
|
@@ -130,4 +130,16 @@ spec:
|
|
|
130
130
|
{{- end }}
|
|
131
131
|
{{- $name }}
|
|
132
132
|
{{- end }}
|
|
133
|
+
{{- end }}
|
|
134
|
+
|
|
135
|
+
{{/*
|
|
136
|
+
Saas Registry Parameters
|
|
137
|
+
*/}}
|
|
138
|
+
{{- define "cap.service-instance.saasRegistryParameters" -}}
|
|
139
|
+
{{- $srvHostFull := include "cap.deploymentHostFull" (merge (dict "name" "srv" "deployment" .Values.srv) . ) }}
|
|
140
|
+
{{- $parameters := .Values.saasRegistryParameters }}
|
|
141
|
+
{{- $appUrls := $parameters.appUrls }}
|
|
142
|
+
{{- $_ := set $appUrls "getDependencies" (printf "https://%s%s" $srvHostFull $appUrls.getDependencies) }}
|
|
143
|
+
{{- $_ := set $appUrls "onSubscription" (printf "https://%s%s" $srvHostFull $appUrls.onSubscription) }}
|
|
144
|
+
{{- $parameters | mustToJson }}
|
|
133
145
|
{{- end }}
|
|
@@ -21,6 +21,46 @@
|
|
|
21
21
|
"$id": "#/properties/html5-apps-deployer",
|
|
22
22
|
"description": "Content Deployment",
|
|
23
23
|
"$ref": "./charts/content-deployment/values.schema.json"
|
|
24
|
+
},
|
|
25
|
+
"event-mesh": {
|
|
26
|
+
"$id": "#/properties/event-mesh",
|
|
27
|
+
"description": "Service Instance",
|
|
28
|
+
"$ref": "./charts/service-instance/values.schema.json"
|
|
29
|
+
},
|
|
30
|
+
"html5-apps-repo-host": {
|
|
31
|
+
"$id": "#/properties/html5-apps-repo-host",
|
|
32
|
+
"description": "Service Instance",
|
|
33
|
+
"$ref": "./charts/service-instance/values.schema.json"
|
|
34
|
+
},
|
|
35
|
+
"xsuaa": {
|
|
36
|
+
"$id": "#/properties/xsuaa",
|
|
37
|
+
"description": "Service Instance",
|
|
38
|
+
"$ref": "./charts/service-instance/values.schema.json"
|
|
39
|
+
},
|
|
40
|
+
"auditlog": {
|
|
41
|
+
"$id": "#/properties/auditlog",
|
|
42
|
+
"description": "Service Instance",
|
|
43
|
+
"$ref": "./charts/service-instance/values.schema.json"
|
|
44
|
+
},
|
|
45
|
+
"destination": {
|
|
46
|
+
"$id": "#/properties/destination",
|
|
47
|
+
"description": "Service Instance",
|
|
48
|
+
"$ref": "./charts/service-instance/values.schema.json"
|
|
49
|
+
},
|
|
50
|
+
"hana": {
|
|
51
|
+
"$id": "#/properties/hana",
|
|
52
|
+
"description": "Service Instance",
|
|
53
|
+
"$ref": "./charts/service-instance/values.schema.json"
|
|
54
|
+
},
|
|
55
|
+
"saas-registry": {
|
|
56
|
+
"$id": "#/properties/saas-registry",
|
|
57
|
+
"description": "Service Instance",
|
|
58
|
+
"$ref": "./charts/service-instance/values.schema.json"
|
|
59
|
+
},
|
|
60
|
+
"service-manager": {
|
|
61
|
+
"$id": "#/properties/service-manager",
|
|
62
|
+
"description": "Service Instance",
|
|
63
|
+
"$ref": "./charts/service-instance/values.schema.json"
|
|
24
64
|
}
|
|
25
65
|
}
|
|
26
66
|
}
|
|
@@ -54,6 +54,38 @@
|
|
|
54
54
|
"$id": "#/properties/approuter",
|
|
55
55
|
"description": "Deployment"
|
|
56
56
|
},
|
|
57
|
+
"event-mesh": {
|
|
58
|
+
"$id": "#/properties/event-mesh",
|
|
59
|
+
"description": "Service Instance"
|
|
60
|
+
},
|
|
61
|
+
"html5-apps-repo-host": {
|
|
62
|
+
"$id": "#/properties/html5-apps-repo-host",
|
|
63
|
+
"description": "Service Instance"
|
|
64
|
+
},
|
|
65
|
+
"xsuaa": {
|
|
66
|
+
"$id": "#/properties/xsuaa",
|
|
67
|
+
"description": "Service Instance"
|
|
68
|
+
},
|
|
69
|
+
"auditlog": {
|
|
70
|
+
"$id": "#/properties/auditlog",
|
|
71
|
+
"description": "Service Instance"
|
|
72
|
+
},
|
|
73
|
+
"destination": {
|
|
74
|
+
"$id": "#/properties/destination",
|
|
75
|
+
"description": "Service Instance"
|
|
76
|
+
},
|
|
77
|
+
"hana": {
|
|
78
|
+
"$id": "#/properties/hana",
|
|
79
|
+
"description": "Service Instance"
|
|
80
|
+
},
|
|
81
|
+
"saas-registry": {
|
|
82
|
+
"$id": "#/properties/saas-registry",
|
|
83
|
+
"description": "Service Instance"
|
|
84
|
+
},
|
|
85
|
+
"service-manager": {
|
|
86
|
+
"$id": "#/properties/service-manager",
|
|
87
|
+
"description": "Service Instance"
|
|
88
|
+
},
|
|
57
89
|
"backendDestinations": {
|
|
58
90
|
"$id": "#/properties/backendDestinations",
|
|
59
91
|
"title": "Backend Destinations for Approuter or HTML5 Apps Deployer",
|
|
@@ -76,75 +108,6 @@
|
|
|
76
108
|
}
|
|
77
109
|
}
|
|
78
110
|
}
|
|
79
|
-
},
|
|
80
|
-
"auditlog": {
|
|
81
|
-
"$id": "#/properties/auditlog",
|
|
82
|
-
"$ref": "#/definitions/ServiceInstance"
|
|
83
|
-
},
|
|
84
|
-
"destinations": {
|
|
85
|
-
"$id": "#/properties/destinations",
|
|
86
|
-
"$ref": "#/definitions/ServiceInstance"
|
|
87
|
-
},
|
|
88
|
-
"connectivity": {
|
|
89
|
-
"type": "object",
|
|
90
|
-
"additionalProperties": false,
|
|
91
|
-
"required": [
|
|
92
|
-
"serviceOfferingName",
|
|
93
|
-
"servicePlanName",
|
|
94
|
-
"configMapName",
|
|
95
|
-
"secretName"
|
|
96
|
-
],
|
|
97
|
-
"properties": {
|
|
98
|
-
"fullnameOverride": {
|
|
99
|
-
"type": "string",
|
|
100
|
-
"pattern": "[0-9a-z][0-9a-z-.]*",
|
|
101
|
-
"maxLength": 63,
|
|
102
|
-
"description": "If present then this will be used instead of the generated name"
|
|
103
|
-
},
|
|
104
|
-
"enabled": {
|
|
105
|
-
"type": "boolean",
|
|
106
|
-
"default": true,
|
|
107
|
-
"description": "Service instance will be created (default: true)"
|
|
108
|
-
},
|
|
109
|
-
"serviceOfferingName": {
|
|
110
|
-
"type": "string",
|
|
111
|
-
"default": "connectivity",
|
|
112
|
-
"description": "Technical service offering name from service catalog"
|
|
113
|
-
},
|
|
114
|
-
"servicePlanName": {
|
|
115
|
-
"type": "string",
|
|
116
|
-
"default": "connectivity_proxy",
|
|
117
|
-
"description": "Technical service plan name from service catalog"
|
|
118
|
-
},
|
|
119
|
-
"parameters": {
|
|
120
|
-
"type": "object",
|
|
121
|
-
"description": "Some services support the provisioning of additional configuration parameters during the instance creation. For the list of supported parameters, check the documentation of the particular service offering."
|
|
122
|
-
},
|
|
123
|
-
"config": {
|
|
124
|
-
"type": "string",
|
|
125
|
-
"description": "File name of JSON configuration file in chart folder. Values from the file will be copied and placed in the parameters for the service instance. If both parameters and config are specified, the values in parameters override those read from config."
|
|
126
|
-
},
|
|
127
|
-
"configMapName": {
|
|
128
|
-
"type": "string",
|
|
129
|
-
"description": "Required to add additional connection information, compared to what is available from the service binding."
|
|
130
|
-
},
|
|
131
|
-
"secretName": {
|
|
132
|
-
"type": "string",
|
|
133
|
-
"description": "Required to add additional connection information."
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
"event_mesh": {
|
|
138
|
-
"$id": "#/properties/event_mesh",
|
|
139
|
-
"$ref": "#/definitions/ServiceInstance"
|
|
140
|
-
},
|
|
141
|
-
"html5_apps_repo_host": {
|
|
142
|
-
"$id": "#/properties/html5_apps_repo_host",
|
|
143
|
-
"$ref": "#/definitions/ServiceInstance"
|
|
144
|
-
},
|
|
145
|
-
"xsuaa": {
|
|
146
|
-
"$id": "#/properties/xsuaa",
|
|
147
|
-
"$ref": "#/definitions/ServiceInstance"
|
|
148
111
|
}
|
|
149
112
|
},
|
|
150
113
|
"definitions": {
|