@sap/cds-dk 9.5.0 → 9.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 +52 -0
- package/bin/cds.js +1 -1
- package/bin/compile/index.js +3 -2
- package/bin/env.js +3 -3
- package/bin/up.js +22 -16
- package/bin/util/containerize.js +27 -14
- package/lib/build/provider/internalBuildPlugin.js +23 -0
- package/lib/build/util.js +33 -16
- package/lib/import/common.js +7 -1
- package/lib/import/odata/v4parser.js +25 -38
- package/lib/init/constants.js +1 -1
- package/lib/init/index.js +7 -1
- package/lib/init/projectReader.js +21 -10
- package/lib/init/template/ams/index.js +2 -2
- package/lib/init/template/app-frontend/files/ui5.yaml.hbs +1 -0
- package/lib/init/template/app-frontend/index.js +2 -2
- package/lib/init/template/application-logging/index.js +2 -2
- package/lib/init/template/approuter/index.js +9 -5
- package/lib/init/template/attachments/index.js +4 -2
- package/lib/init/template/audit-logging/index.js +4 -2
- package/lib/init/template/cloud-logging/index.js +4 -2
- package/lib/init/template/connectivity/index.js +2 -2
- package/lib/init/template/console/files/package.json +5 -0
- package/lib/init/template/console/index.js +25 -0
- package/lib/init/template/containerize/index.js +4 -2
- package/lib/init/template/destination/index.js +4 -2
- package/lib/init/template/dynatrace/files/package.json.hbs +2 -2
- package/lib/init/template/dynatrace/index.js +4 -2
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +3 -1
- package/lib/init/template/enterprise-messaging/index.js +4 -2
- package/lib/init/template/enterprise-messaging-shared/index.js +4 -2
- package/lib/init/template/github-actions/files/workflows/release.yaml.hbs +2 -2
- package/lib/init/template/github-actions/index.js +4 -4
- package/lib/init/template/hana/index.js +4 -4
- package/lib/init/template/helm/index.js +6 -3
- package/lib/init/template/helm-unified-runtime/index.js +1 -0
- package/lib/init/template/html5-repo/files/ui5.yaml.hbs +1 -0
- package/lib/init/template/html5-repo/index.js +9 -7
- package/lib/init/template/ias/index.js +2 -2
- package/lib/init/template/java/index.js +14 -0
- package/lib/init/template/kafka/index.js +4 -2
- package/lib/init/template/kyma/index.js +124 -13
- package/lib/init/template/malware-scanner/index.js +4 -2
- package/lib/init/template/mta/index.js +1 -1
- package/lib/init/template/multitenancy/index.js +7 -4
- package/lib/init/template/nodejs/files/.vscode/extensions.json +0 -3
- package/lib/init/template/pipeline/files/ui5.yaml.hbs +1 -0
- package/lib/init/template/portal/index.js +6 -3
- package/lib/init/template/postgres/index.js +2 -2
- package/lib/init/template/redis/index.js +2 -3
- package/lib/init/template/redis-messaging/index.js +2 -3
- package/lib/init/template/sample/files/_i18n/i18n_de.properties +9 -0
- package/lib/init/template/sample/files/_i18n/i18n_fr.properties +1 -0
- package/lib/init/template/sample/files/app/_i18n/i18n.properties +17 -0
- package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +16 -2
- package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n.properties +3 -11
- package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n_de.properties +3 -0
- package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n_en.properties +3 -0
- package/lib/init/template/sample/files/app/admin-authors/webapp/manifest.json +1 -1
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +3 -11
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_de.properties +3 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_en.properties +3 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +1 -1
- package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +6 -6
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +3 -11
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_de.properties +3 -0
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_en.properties +3 -0
- package/lib/init/template/sample/files/app/browse/webapp/manifest.json +1 -1
- package/lib/init/template/sample/files/app/common.cds +2 -1
- package/lib/init/template/sample/files/app/fiori-apps.html +32 -12
- package/lib/init/template/sample/files/app/genres/fiori-service.cds +1 -1
- package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n.properties +3 -4
- package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n_de.properties +3 -2
- package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n_en.properties +3 -0
- package/lib/init/template/sample/files/app/genres/webapp/manifest.json +2 -2
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.texts.csv +43 -0
- package/lib/init/template/sample/index.js +14 -1
- package/lib/init/template/sqlite/files/package.json.hbs +13 -0
- package/lib/init/template/sqlite/index.js +1 -1
- package/lib/init/template/xsuaa/index.js +5 -2
- package/lib/lint/eslintHelp.json +1 -1
- package/lib/util/checksum.js +19 -10
- package/lib/util/fs.js +8 -1
- package/lib/util/glob.js +26 -13
- package/lib/util/term.js +3 -1
- package/lib/watch/livereload-server.js +4 -3
- package/lib/watch/node-watch.js +5 -8
- package/lib/watch/watcher.js +136 -0
- package/npm-shrinkwrap.json +110 -117
- package/package.json +2 -3
- package/lib/init/template/sample/files/app/_i18n/i18n_en.properties +0 -8
- package/lib/init/template/sqlite/files/package.json +0 -5
- /package/lib/init/template/{helm → kyma}/files/Chart.yaml.hbs +0 -0
- /package/lib/init/template/{containerize → kyma}/files/containerize.yaml.hbs +0 -0
- /package/lib/init/template/{helm → kyma}/files/values.schema.json +0 -0
- /package/lib/init/template/{helm → kyma}/files/values.yaml.hbs +0 -0
|
@@ -76,7 +76,7 @@ module.exports = new class ProjectReader {
|
|
|
76
76
|
const _isESM = () => pkgJson().type === 'module'
|
|
77
77
|
const _isTypescript = () => !!pkgJson().dependencies?.typescript || !!pkgJson().devDependencies?.typescript
|
|
78
78
|
const _hasTyper = () => !!pkgJson().dependencies?.['@cap-js/cds-typer'] || !!pkgJson().devDependencies?.['@cap-js/cds-typer']
|
|
79
|
-
const _inProd = plugin => require(`./template/${plugin}`).hasInProduction(env) || cds.cli.argv[0]?.includes(plugin) || cds.cli.options.add?.has(plugin)
|
|
79
|
+
const _inProd = plugin => require(`./template/${plugin}`).hasInProduction(env) || cds.cli.command === 'add' && cds.cli.argv[0]?.split(',').includes(plugin) || cds.cli.options.add?.has(plugin)
|
|
80
80
|
const _uiEmbedded = () => exists(join(env.folders.app, 'xs-app.json'))
|
|
81
81
|
const _uiModule = () => !_uiEmbedded() && isdir(env.folders.app) && fs.readdirSync(resolve(cds.root, env.folders.app)).length > 0
|
|
82
82
|
const _isJava = () => this.isJava
|
|
@@ -125,14 +125,17 @@ module.exports = new class ProjectReader {
|
|
|
125
125
|
const vizId = firstInbound.semanticObject + '-' + firstInbound.action
|
|
126
126
|
// Try to read archiveName from ui5.yaml if it exists
|
|
127
127
|
let archiveName = ''
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
const ui5YamlPaths = [
|
|
129
|
+
path.resolve(cds.root, cds.env.folders.app, app, 'ui5-deploy.yaml'),
|
|
130
|
+
path.resolve(cds.root, cds.env.folders.app, app, 'ui5.yaml')
|
|
131
|
+
]
|
|
132
|
+
for (const yamlPath of ui5YamlPaths) {
|
|
133
|
+
if (exists(yamlPath)) {
|
|
134
|
+
const ui5Deploy = cds.load.yaml(yamlPath)
|
|
135
|
+
const zipperTask = ui5Deploy?.builder?.customTasks?.find?.(t => t.name === 'ui5-task-zipper')
|
|
134
136
|
if (zipperTask?.configuration?.archiveName) {
|
|
135
137
|
archiveName = `${zipperTask.configuration.archiveName}.zip`
|
|
138
|
+
break
|
|
136
139
|
}
|
|
137
140
|
}
|
|
138
141
|
}
|
|
@@ -190,7 +193,14 @@ module.exports = new class ProjectReader {
|
|
|
190
193
|
values: values ?? {},
|
|
191
194
|
containerize: containerize ?? {}
|
|
192
195
|
}
|
|
193
|
-
}
|
|
196
|
+
},
|
|
197
|
+
hasHelmUnifiedRuntime: () =>
|
|
198
|
+
exists(join(cds.root, 'chart', 'Chart.yaml')) &&
|
|
199
|
+
(() => {
|
|
200
|
+
const chartYaml = cds.load.yaml(join(cds.root, 'chart', 'Chart.yaml'))
|
|
201
|
+
return chartYaml.annotations?.['app.kubernetes.io/managed-by'] === 'cds-dk/helm'
|
|
202
|
+
&& chartYaml.dependencies?.find(dep => dep.name === 'web-application')?.repository !== undefined
|
|
203
|
+
})()
|
|
194
204
|
}
|
|
195
205
|
|
|
196
206
|
// Automatically creates availability checks for `cds add` commands.
|
|
@@ -205,7 +215,7 @@ module.exports = new class ProjectReader {
|
|
|
205
215
|
const facet = p.slice(prefix.length).replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()
|
|
206
216
|
const inProd = _inProd(facet)
|
|
207
217
|
if (prefix === 'add') {
|
|
208
|
-
const adding =
|
|
218
|
+
const adding = plugin => cds.cli.command === 'add' && cds.cli.argv[0]?.split(',').includes(plugin) || cds.cli.options.add?.has(plugin)
|
|
209
219
|
const caller = new Error().stack.split('\n')[3].replace(/\\/g, '/').match(/lib\/init\/template\/([^/]+)\/index\.js/)[1]
|
|
210
220
|
return inProd && (adding(facet) || adding(caller))
|
|
211
221
|
}
|
|
@@ -302,6 +312,7 @@ function _normalizeSpringBootCfg(obj) {
|
|
|
302
312
|
* @property {boolean} hasTyper Indicates if code supports CDS typer.
|
|
303
313
|
* @property {boolean} hasHelmUnifiedRuntime Indicates if the project uses Unified Runtime Helm deployment.
|
|
304
314
|
* @property {boolean} hasHelm Indicates if the project uses CAP Helm deployment.
|
|
315
|
+
* @property {boolean} hasKyma Indicates if the project uses Kyma.
|
|
305
316
|
* @property {boolean} hasMta Indicates if the project uses MTA deployment.
|
|
306
317
|
* @property {boolean} hasConnectivity Indicates if the project uses connectivity.
|
|
307
318
|
* @property {boolean} hasMultitenancy Indicates if the project is multitenant.
|
|
@@ -326,4 +337,4 @@ function _normalizeSpringBootCfg(obj) {
|
|
|
326
337
|
* @property {String} githubSlug GitHub org/repo.
|
|
327
338
|
* @property {boolean} isMonorepoMicroservice Indicates if the project is a monorepo microservice.
|
|
328
339
|
* @property {String} npmWorkspaceRoot The root path of the monorepo workspace.
|
|
329
|
-
*/
|
|
340
|
+
*/
|
|
@@ -28,7 +28,7 @@ module.exports = class AmsTemplate extends require('../../plugin') {
|
|
|
28
28
|
|
|
29
29
|
async combine() {
|
|
30
30
|
const project = readProject()
|
|
31
|
-
const { addMta, addCfManifest,
|
|
31
|
+
const { addMta, addCfManifest, addContainerize, addKyma } = project
|
|
32
32
|
|
|
33
33
|
if (addMta) {
|
|
34
34
|
await this.#combineWithMta(project)
|
|
@@ -38,7 +38,7 @@ module.exports = class AmsTemplate extends require('../../plugin') {
|
|
|
38
38
|
await this.#combineWithCfManifest(project)
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
if (
|
|
41
|
+
if (addKyma) {
|
|
42
42
|
await this.#combineWithHelm(project)
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -79,14 +79,14 @@ module.exports = class extends require('../../plugin') {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// When Helm support is added
|
|
82
|
-
// if (hasContainerize) {
|
|
82
|
+
// if (hasContainerize || hasKyma) {
|
|
83
83
|
// const additions = [{
|
|
84
84
|
// in: 'modules',
|
|
85
85
|
// where: { name: `${project.appName}-content-deployer` }
|
|
86
86
|
// }]
|
|
87
87
|
// await merge(__dirname, '/files/containerize.yaml.hbs').into('containerize.yaml', { with: project, additions })
|
|
88
88
|
// }
|
|
89
|
-
// if (
|
|
89
|
+
// if (hasKyma) {
|
|
90
90
|
// await renderAndCopy(join(__dirname, 'files/ui-resources'), 'ui-resources', project)
|
|
91
91
|
// await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project })
|
|
92
92
|
// }
|
|
@@ -14,8 +14,8 @@ module.exports = class ApplicationLoggingTemplate extends require('../../plugin'
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
async canRun() {
|
|
17
|
-
const { hasMta,
|
|
18
|
-
if (
|
|
17
|
+
const { hasMta, hasKyma } = readProject()
|
|
18
|
+
if (hasKyma && !hasMta) throw `'cds add application-logging' is not available for Kyma yet`
|
|
19
19
|
return true
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -11,6 +11,7 @@ const {
|
|
|
11
11
|
approuterMTXRoute,
|
|
12
12
|
approuterMTXRouteJava // xs-app.json config
|
|
13
13
|
} = require('../../registries/mta')
|
|
14
|
+
const KymaTemplate = require('../kyma')
|
|
14
15
|
|
|
15
16
|
module.exports = class ApprouterTemplate extends require('../../plugin') {
|
|
16
17
|
|
|
@@ -35,9 +36,8 @@ module.exports = class ApprouterTemplate extends require('../../plugin') {
|
|
|
35
36
|
const {
|
|
36
37
|
isNodejs, isJava,
|
|
37
38
|
addIas, addXsuaa, hasXsuaa, hasIas, addMultitenancy, hasMTXRoute, hasMTXRouteJava,
|
|
38
|
-
addMta,
|
|
39
|
-
|
|
40
|
-
addContainerize, srvPath, approuterPath
|
|
39
|
+
addMta, hasMta, hasMultitenancy,
|
|
40
|
+
addContainerize, addKyma, hasKyma, srvPath, approuterPath
|
|
41
41
|
} = project
|
|
42
42
|
|
|
43
43
|
|
|
@@ -68,11 +68,15 @@ module.exports = class ApprouterTemplate extends require('../../plugin') {
|
|
|
68
68
|
})
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
if
|
|
71
|
+
if(addKyma) {
|
|
72
|
+
await KymaTemplate.mergeDependency('web-application', 'approuter')
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (addKyma || (addMultitenancy && hasKyma)) {
|
|
72
76
|
await merge(__dirname, 'files', 'values.yaml.hbs').into('chart/values.yaml', { with: project })
|
|
73
77
|
}
|
|
74
78
|
|
|
75
|
-
if (addContainerize) {
|
|
79
|
+
if (addContainerize || addKyma) {
|
|
76
80
|
const additions = [{
|
|
77
81
|
in: 'modules',
|
|
78
82
|
where: { name: `${project.appName}-approuter` }
|
|
@@ -2,6 +2,7 @@ const { readProject } = require('../../projectReader')
|
|
|
2
2
|
const { merge } = require('../../merge')
|
|
3
3
|
const { srv4, attachments } = require('../../registries/mta')
|
|
4
4
|
const { mvn } = require('../../add')
|
|
5
|
+
const KymaTemplate = require('../kyma')
|
|
5
6
|
|
|
6
7
|
module.exports = class AttachmentsTemplate extends require('../../plugin') {
|
|
7
8
|
|
|
@@ -26,7 +27,7 @@ module.exports = class AttachmentsTemplate extends require('../../plugin') {
|
|
|
26
27
|
|
|
27
28
|
async combine() {
|
|
28
29
|
const project = readProject()
|
|
29
|
-
const { addMta,
|
|
30
|
+
const { addMta, addKyma, srvPath } = project
|
|
30
31
|
|
|
31
32
|
if (addMta) {
|
|
32
33
|
const srv = srv4(srvPath)
|
|
@@ -40,8 +41,9 @@ module.exports = class AttachmentsTemplate extends require('../../plugin') {
|
|
|
40
41
|
})
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
if (
|
|
44
|
+
if (addKyma) {
|
|
44
45
|
await merge(__dirname, 'files', 'values.yaml').into('chart/values.yaml')
|
|
46
|
+
await KymaTemplate.mergeDependency('service-instance', 'attachments')
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -4,6 +4,7 @@ const { readProject } = require('../../projectReader')
|
|
|
4
4
|
const { merge } = require('../../merge')
|
|
5
5
|
const { srv4, auditlog } = require('../../registries/mta')
|
|
6
6
|
const mvn = require('../../mvn')
|
|
7
|
+
const KymaTemplate = require('../kyma')
|
|
7
8
|
|
|
8
9
|
module.exports = class AuditLoggingTemplate extends require('../../plugin') {
|
|
9
10
|
|
|
@@ -33,7 +34,7 @@ module.exports = class AuditLoggingTemplate extends require('../../plugin') {
|
|
|
33
34
|
|
|
34
35
|
async combine() {
|
|
35
36
|
const project = readProject()
|
|
36
|
-
const { addMta,
|
|
37
|
+
const { addMta, addKyma, addMultitenancy, srvPath } = project
|
|
37
38
|
const { plan = 'premium' } = cds.cli.options
|
|
38
39
|
project.servicePlan = plan
|
|
39
40
|
|
|
@@ -53,7 +54,7 @@ module.exports = class AuditLoggingTemplate extends require('../../plugin') {
|
|
|
53
54
|
]
|
|
54
55
|
})
|
|
55
56
|
}
|
|
56
|
-
if (
|
|
57
|
+
if (addKyma) {
|
|
57
58
|
await merge({
|
|
58
59
|
srv: { bindings: { auditlog: { serviceInstanceName: 'auditlog' }}},
|
|
59
60
|
auditlog: {
|
|
@@ -61,6 +62,7 @@ module.exports = class AuditLoggingTemplate extends require('../../plugin') {
|
|
|
61
62
|
servicePlanName: plan
|
|
62
63
|
}
|
|
63
64
|
}).into('chart/values.yaml')
|
|
65
|
+
await KymaTemplate.mergeDependency('service-instance', 'auditlog')
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
}
|
|
@@ -4,6 +4,7 @@ const { merge, sort } = require('../../merge')
|
|
|
4
4
|
const mvn = require('../../mvn')
|
|
5
5
|
const { readProject } = require('../../projectReader')
|
|
6
6
|
const { srv4, mtxSidecar4, approuter } = require('../../registries/mta')
|
|
7
|
+
const KymaTemplate = require('../kyma')
|
|
7
8
|
|
|
8
9
|
module.exports = class extends require('../../plugin') {
|
|
9
10
|
|
|
@@ -39,7 +40,7 @@ module.exports = class extends require('../../plugin') {
|
|
|
39
40
|
|
|
40
41
|
async combine() {
|
|
41
42
|
const project = readProject()
|
|
42
|
-
const { hasMta, addMta,
|
|
43
|
+
const { hasMta, addMta, addKyma, addApprouter, isJava, addMultitenancy, srvPath } = project
|
|
43
44
|
|
|
44
45
|
if (addMta || (addMultitenancy || addApprouter) && hasMta) {
|
|
45
46
|
const cloudLogging = {
|
|
@@ -76,8 +77,9 @@ module.exports = class extends require('../../plugin') {
|
|
|
76
77
|
with: project, additions, relationships
|
|
77
78
|
})
|
|
78
79
|
}
|
|
79
|
-
if (
|
|
80
|
+
if (addKyma) {
|
|
80
81
|
await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml')
|
|
82
|
+
await KymaTemplate.mergeDependency('service-instance', 'cloud-logging')
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
}
|
|
@@ -20,7 +20,7 @@ module.exports = class ConnectivityTemplate extends require('../../plugin') {
|
|
|
20
20
|
|
|
21
21
|
async combine() {
|
|
22
22
|
const project = readProject()
|
|
23
|
-
const { srvPath,
|
|
23
|
+
const { srvPath, addKyma, addMta } = project
|
|
24
24
|
|
|
25
25
|
if (addMta) {
|
|
26
26
|
const srv = srv4(srvPath)
|
|
@@ -32,7 +32,7 @@ module.exports = class ConnectivityTemplate extends require('../../plugin') {
|
|
|
32
32
|
await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', { project, additions, relationships })
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
if (
|
|
35
|
+
if (addKyma) {
|
|
36
36
|
await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', {
|
|
37
37
|
project,
|
|
38
38
|
additions: [{
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { join } = require("path");
|
|
2
|
+
const mvn = require("../../mvn");
|
|
3
|
+
|
|
4
|
+
const { readProject } = require("../../projectReader");
|
|
5
|
+
const { merge } = require("../../merge");
|
|
6
|
+
|
|
7
|
+
module.exports = class ConsoleTemplate extends require("../../plugin") {
|
|
8
|
+
static help() {
|
|
9
|
+
return "installs the CAP console plugin";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async run() {
|
|
13
|
+
const { isJava } = readProject();
|
|
14
|
+
|
|
15
|
+
if (isJava) {
|
|
16
|
+
await mvn.add("CAP_JAVA_PLUGIN", {
|
|
17
|
+
groupId: "com.sap.cds",
|
|
18
|
+
artifactId: "cds-feature-console",
|
|
19
|
+
version: "1.0.0"
|
|
20
|
+
});
|
|
21
|
+
} else {
|
|
22
|
+
await merge(join(__dirname, "files", "package.json")).into("package.json");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -2,19 +2,21 @@ const cds = require('../../../cds')
|
|
|
2
2
|
const { exists, rimraf } = cds.utils
|
|
3
3
|
const { readProject } = require('../../projectReader');
|
|
4
4
|
const { merge } = require('../../merge')
|
|
5
|
+
const term = require('../../../../lib/util/term')
|
|
5
6
|
|
|
7
|
+
// cds10: Remove this and all usages of addContainerize/hasContainerize
|
|
6
8
|
module.exports = class ContainerizeTemplate extends require('../../plugin') {
|
|
7
9
|
|
|
8
10
|
static hasInProduction () {
|
|
9
11
|
return exists('containerize.yaml')
|
|
10
12
|
}
|
|
11
|
-
|
|
12
13
|
async run() {
|
|
14
|
+
console.warn(term.warn(`The "cds add containerize" command is deprecated and will be removed in the next major release. Please use the "cds add kyma" command instead.`))
|
|
13
15
|
if (cds.cli.options.force) {
|
|
14
16
|
await rimraf('containerize.yaml')
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
const project = readProject()
|
|
18
|
-
await merge(__dirname, '/files/containerize.yaml.hbs').into('containerize.yaml', { with: project })
|
|
20
|
+
await merge(__dirname, '../kyma/files/containerize.yaml.hbs').into('containerize.yaml', { with: project })
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const { readProject } = require('../../projectReader')
|
|
2
2
|
const { merge } = require('../../merge')
|
|
3
3
|
const { srv4, approuter, destination, mtxSidecar4 } = require('../../registries/mta')
|
|
4
|
+
const KymaTemplate = require('../kyma')
|
|
4
5
|
|
|
5
6
|
module.exports = class DestinationTemplate extends require('../../plugin') {
|
|
6
7
|
|
|
@@ -24,7 +25,7 @@ module.exports = class DestinationTemplate extends require('../../plugin') {
|
|
|
24
25
|
|
|
25
26
|
async combine() {
|
|
26
27
|
const project = readProject()
|
|
27
|
-
const {
|
|
28
|
+
const { addApprouter, addMultitenancy, addKyma, addMta, hasMta, srvPath, isJava } = project
|
|
28
29
|
|
|
29
30
|
if (addMta || (addApprouter || addMultitenancy) && hasMta) {
|
|
30
31
|
const srv = srv4(srvPath)
|
|
@@ -48,8 +49,9 @@ module.exports = class DestinationTemplate extends require('../../plugin') {
|
|
|
48
49
|
await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', { with: project, additions, relationships })
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
if (
|
|
52
|
+
if (addKyma) {
|
|
52
53
|
await merge(__dirname, 'files/values.yaml').into('chart/values.yaml')
|
|
54
|
+
await KymaTemplate.mergeDependency('service-instance', 'destination')
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@cap-js/telemetry": ">=0",
|
|
4
|
-
"@opentelemetry/exporter-metrics-otlp-proto": "<0.200"{{#
|
|
4
|
+
"@opentelemetry/exporter-metrics-otlp-proto": "<0.200"{{#hasKyma}},
|
|
5
5
|
"@opentelemetry/host-metrics": "<0.200"
|
|
6
|
-
{{/
|
|
6
|
+
{{/hasKyma}}
|
|
7
7
|
},
|
|
8
8
|
"cds": {
|
|
9
9
|
"requires": {
|
|
@@ -2,6 +2,7 @@ const { merge, sort } = require('../../merge')
|
|
|
2
2
|
|
|
3
3
|
const { readProject } = require('../../projectReader')
|
|
4
4
|
const { srv4, mtxSidecar4 } = require('../../registries/mta')
|
|
5
|
+
const KymaTemplate = require('../kyma')
|
|
5
6
|
|
|
6
7
|
module.exports = class extends require('../../plugin') {
|
|
7
8
|
|
|
@@ -24,7 +25,7 @@ module.exports = class extends require('../../plugin') {
|
|
|
24
25
|
|
|
25
26
|
async combine() {
|
|
26
27
|
const project = readProject()
|
|
27
|
-
const { appName, addMta,
|
|
28
|
+
const { appName, addMta, addKyma, isJava, addMultitenancy, srvPath } = project
|
|
28
29
|
|
|
29
30
|
if (addMta || addMultitenancy) {
|
|
30
31
|
const dynatrace = {
|
|
@@ -55,8 +56,9 @@ module.exports = class extends require('../../plugin') {
|
|
|
55
56
|
})
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
if (
|
|
59
|
+
if (addKyma) {
|
|
59
60
|
await merge(__dirname, 'files', 'values.yaml').into('chart/values.yaml')
|
|
61
|
+
await KymaTemplate.mergeDependency('service-instance', 'dynatrace')
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
}
|
|
@@ -13,7 +13,9 @@ resources:
|
|
|
13
13
|
service: enterprise-messaging
|
|
14
14
|
service-plan: default
|
|
15
15
|
path: ./event-mesh.json
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
- name: {{appName}}-auth
|
|
18
|
+
type: org.cloudfoundry.managed-service
|
|
17
19
|
parameters:
|
|
18
20
|
service: xsuaa
|
|
19
21
|
service-plan: application
|
|
@@ -3,6 +3,7 @@ const { read, exists, yaml: YAML } = cds.utils
|
|
|
3
3
|
const { readProject } = require('../../projectReader')
|
|
4
4
|
const { merge } = require('../../merge')
|
|
5
5
|
const { srv4, enterpriseMessaging, xsuaa } = require('../../registries/mta')
|
|
6
|
+
const KymaTemplate = require('../kyma')
|
|
6
7
|
|
|
7
8
|
module.exports = class EnterpriseMessagingTemplate extends require('../../plugin') {
|
|
8
9
|
|
|
@@ -41,7 +42,7 @@ module.exports = class EnterpriseMessagingTemplate extends require('../../plugin
|
|
|
41
42
|
|
|
42
43
|
async combine() {
|
|
43
44
|
const project = readProject()
|
|
44
|
-
const { addXsuaa,
|
|
45
|
+
const { addXsuaa, addKyma, addMta, srvPath, appName } = project
|
|
45
46
|
|
|
46
47
|
if (addMta) {
|
|
47
48
|
const srv = srv4(srvPath)
|
|
@@ -72,8 +73,9 @@ module.exports = class EnterpriseMessagingTemplate extends require('../../plugin
|
|
|
72
73
|
})
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
if (
|
|
76
|
+
if (addKyma) {
|
|
76
77
|
await merge(__dirname, 'files', 'values.yaml').into('chart/values.yaml')
|
|
78
|
+
await KymaTemplate.mergeDependency('service-instance', 'event-mesh')
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
if (!exists('event-mesh.json')) await merge(__dirname, 'files/event-mesh.json.hbs').into('event-mesh.json', { project })
|
|
@@ -3,6 +3,7 @@ const { read, exists } = cds.utils
|
|
|
3
3
|
const { readProject } = require('../../projectReader')
|
|
4
4
|
const { merge } = require('../../merge')
|
|
5
5
|
const { srv4, enterpriseMessaging } = require('../../registries/mta')
|
|
6
|
+
const KymaTemplate = require('../kyma')
|
|
6
7
|
|
|
7
8
|
module.exports = class EnterpriseMessagingSharedTemplate extends require('../../plugin') {
|
|
8
9
|
|
|
@@ -42,7 +43,7 @@ module.exports = class EnterpriseMessagingSharedTemplate extends require('../../
|
|
|
42
43
|
|
|
43
44
|
async combine() {
|
|
44
45
|
const project = readProject()
|
|
45
|
-
const { addMta,
|
|
46
|
+
const { addMta, addKyma, srvPath } = project
|
|
46
47
|
|
|
47
48
|
if (addMta) {
|
|
48
49
|
const srv = srv4(srvPath)
|
|
@@ -56,8 +57,9 @@ module.exports = class EnterpriseMessagingSharedTemplate extends require('../../
|
|
|
56
57
|
})
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
if (
|
|
60
|
+
if (addKyma) {
|
|
60
61
|
await merge(__dirname, 'files/values.yaml').into('chart/values.yaml')
|
|
62
|
+
await KymaTemplate.mergeDependency('service-instance', 'event-mesh')
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
if (!exists('event-mesh.json')) await merge(__dirname, 'files/event-mesh.json.hbs').into('event-mesh.json', { project })
|
|
@@ -20,11 +20,11 @@ jobs:
|
|
|
20
20
|
secrets: inherit
|
|
21
21
|
with:
|
|
22
22
|
environment: Production
|
|
23
|
-
{{/hasMta}}{{^hasMta}}{{#
|
|
23
|
+
{{/hasMta}}{{^hasMta}}{{#hasKyma}}
|
|
24
24
|
deploy-kyma:
|
|
25
25
|
needs: [tests]
|
|
26
26
|
uses: {{& githubSlug}}/.github/workflows/kyma.yaml@main
|
|
27
27
|
secrets: inherit
|
|
28
28
|
with:
|
|
29
29
|
environment: Production
|
|
30
|
-
{{/
|
|
30
|
+
{{/hasKyma}}{{/hasMta}}
|
|
@@ -24,7 +24,7 @@ module.exports = class GitHubActionTemplate extends require('../../plugin') {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
async run() {
|
|
27
|
-
const { hasMta,
|
|
27
|
+
const { hasMta, hasKyma, isJava } = readProject()
|
|
28
28
|
const test = `.github/workflows/test.yaml`
|
|
29
29
|
const { force, sap } = cds.cli.options
|
|
30
30
|
if (!exists(test) || force) {
|
|
@@ -43,7 +43,7 @@ module.exports = class GitHubActionTemplate extends require('../../plugin') {
|
|
|
43
43
|
githubSlug = '<org/repo>'
|
|
44
44
|
// console.log(`\ncould not determine GitHub URL for the project – replace '<org/repo>' in ${release}`, DEBUG ? error : '')
|
|
45
45
|
}
|
|
46
|
-
await renderAndCopy(path.join(__dirname, 'files/workflows/release.yaml.hbs'), release, { isJava, sap: cds.cli.options.sap, githubSlug, hasMta,
|
|
46
|
+
await renderAndCopy(path.join(__dirname, 'files/workflows/release.yaml.hbs'), release, { isJava, sap: cds.cli.options.sap, githubSlug, hasMta, hasKyma })
|
|
47
47
|
} else {
|
|
48
48
|
console.log('> skipping ' + release)
|
|
49
49
|
}
|
|
@@ -51,7 +51,7 @@ module.exports = class GitHubActionTemplate extends require('../../plugin') {
|
|
|
51
51
|
|
|
52
52
|
async combine() {
|
|
53
53
|
const project = readProject()
|
|
54
|
-
const { addMta,
|
|
54
|
+
const { addMta, addKyma } = project, { force } = cds.cli.options
|
|
55
55
|
project.sap = cds.cli.options.sap
|
|
56
56
|
if (addMta) {
|
|
57
57
|
const cf = '.github/workflows/cf.yaml'
|
|
@@ -59,7 +59,7 @@ module.exports = class GitHubActionTemplate extends require('../../plugin') {
|
|
|
59
59
|
await renderAndCopy(path.join(__dirname, 'files/workflows/cf.yaml.hbs'), cf, project)
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
62
|
+
if (addKyma) {
|
|
63
63
|
const kyma = '.github/workflows/kyma.yaml'
|
|
64
64
|
if (force || !exists(kyma)) {
|
|
65
65
|
await renderAndCopy(path.join(__dirname, 'files/workflows/kyma.yaml.hbs'), kyma, project)
|
|
@@ -43,7 +43,7 @@ module.exports = class HanaTemplate extends require('../../plugin') {
|
|
|
43
43
|
|
|
44
44
|
async combine() {
|
|
45
45
|
const project = readProject()
|
|
46
|
-
const { addMta, hasMta,
|
|
46
|
+
const { addMta, hasMta, addMultitenancy, addContainerize, addKyma, isJava, hasKyma, hasMultitenancy, srvPath } = project
|
|
47
47
|
|
|
48
48
|
if (addMta || addMultitenancy && hasMta) {
|
|
49
49
|
const srv = srv4(srvPath)
|
|
@@ -85,11 +85,11 @@ module.exports = class HanaTemplate extends require('../../plugin') {
|
|
|
85
85
|
})
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
if (!hasMultitenancy &&
|
|
88
|
+
if (!hasMultitenancy && addKyma) {
|
|
89
89
|
await merge(__dirname, 'files', 'values.yaml.hbs').into('chart/values.yaml', { with: project })
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
if (addMultitenancy &&
|
|
92
|
+
if (addMultitenancy && hasKyma) {
|
|
93
93
|
await merge('chart/values.yaml')
|
|
94
94
|
.remove(['hana-deployer', 'srv.bindings.db', 'hana'])
|
|
95
95
|
|
|
@@ -100,7 +100,7 @@ module.exports = class HanaTemplate extends require('../../plugin') {
|
|
|
100
100
|
])
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
if (addContainerize && !hasMultitenancy) {
|
|
103
|
+
if ((addContainerize || addKyma) && !hasMultitenancy) {
|
|
104
104
|
const additions = [{
|
|
105
105
|
in: 'modules',
|
|
106
106
|
where: { name: `${project.appName}-hana-deployer` }
|
|
@@ -6,7 +6,9 @@ const { merge } = require('../../merge')
|
|
|
6
6
|
const { ask4 } = require('../../../util/question')
|
|
7
7
|
const { execSync } = require('child_process')
|
|
8
8
|
const { mvn } = require('../../add')
|
|
9
|
+
const term = require('../../../../lib/util/term')
|
|
9
10
|
|
|
11
|
+
// cds10: Remove this plugin and hasHelm doc in projectReader
|
|
10
12
|
module.exports = class HelmTemplate extends require('../../plugin') {
|
|
11
13
|
|
|
12
14
|
options() {
|
|
@@ -38,6 +40,7 @@ module.exports = class HelmTemplate extends require('../../plugin') {
|
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
async run() {
|
|
43
|
+
console.warn(term.warn(`The "cds add helm" command is deprecated and will be removed in the next major release. Please use the "cds add kyma" command instead.`))
|
|
41
44
|
const project = readProject()
|
|
42
45
|
let imagePullSecret, registry, domain, tag
|
|
43
46
|
if (!HelmTemplate.hasInProduction() && !project.isBas /* don't run this for the BAS Yeoman generator */) {
|
|
@@ -61,9 +64,9 @@ module.exports = class HelmTemplate extends require('../../plugin') {
|
|
|
61
64
|
project.domain = domain ?? '<cluster-domain>'
|
|
62
65
|
project.imagePullSecret = imagePullSecret ?? 'docker-registry'
|
|
63
66
|
project.tag = tag ?? 'latest'
|
|
64
|
-
await copy(join(__dirname, 'files
|
|
65
|
-
await merge(__dirname, 'files/Chart.yaml.hbs').into('chart/Chart.yaml', { with: project })
|
|
66
|
-
await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project })
|
|
67
|
+
await copy(join(__dirname, '../kyma/files/values.schema.json')).to('chart/values.schema.json')
|
|
68
|
+
await merge(__dirname, '../kyma/files/Chart.yaml.hbs').into('chart/Chart.yaml', { with: project })
|
|
69
|
+
await merge(__dirname, '../kyma/files/values.yaml.hbs').into('chart/values.yaml', { with: project })
|
|
67
70
|
await this._mergeDependency('web-application', 'srv')
|
|
68
71
|
if (project.isJava) await mvn.add('k8s')
|
|
69
72
|
}
|
|
@@ -6,6 +6,7 @@ const { join } = require('path')
|
|
|
6
6
|
const { readProject } = require('../../projectReader')
|
|
7
7
|
const { merge } = require('../../merge')
|
|
8
8
|
|
|
9
|
+
// cds10: Remove this plugin (hasHelmUnifiedRuntime is already replaced in projectReader)
|
|
9
10
|
module.exports = class HelmUnifiedRuntimeTemplate extends require('../helm') {
|
|
10
11
|
|
|
11
12
|
options() {
|