@sap/cds-dk 9.5.0 → 9.6.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 +38 -0
- package/bin/env.js +3 -3
- package/bin/up.js +22 -16
- package/bin/util/containerize.js +27 -14
- 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 +5 -0
- package/lib/init/projectReader.js +19 -8
- 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/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 +1 -0
- 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/npm-shrinkwrap.json +101 -102
- package/package.json +1 -1
- 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
|
@@ -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() {
|
|
@@ -9,8 +9,8 @@ const { renderAndCopy } = require('../../template')
|
|
|
9
9
|
module.exports = class Html5RepoTemplate extends require('../../plugin') {
|
|
10
10
|
|
|
11
11
|
requires() {
|
|
12
|
-
const {
|
|
13
|
-
if (
|
|
12
|
+
const { hasKyma } = readProject()
|
|
13
|
+
if (hasKyma) return ['destination']
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
static help() {
|
|
@@ -37,8 +37,8 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
|
|
|
37
37
|
const project = readProject()
|
|
38
38
|
const {
|
|
39
39
|
isJava, srvPath, appPath, apps,
|
|
40
|
-
hasApprouter, addApprouter, addContainerize, addMultitenancy, addWorkzoneStandard,
|
|
41
|
-
addSample, hasMta, addMta, hasXsuaa, hasMultitenancy,
|
|
40
|
+
hasApprouter, addApprouter, addContainerize, addKyma, addHelm, addHelmUnifiedRuntime, addMultitenancy, addWorkzoneStandard, addXsuaa,
|
|
41
|
+
addSample, hasMta, addMta, hasXsuaa, hasMultitenancy, hasUI5
|
|
42
42
|
} = project
|
|
43
43
|
|
|
44
44
|
await Promise.all(apps.map(async ({ app }) => {
|
|
@@ -65,7 +65,7 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
|
|
|
65
65
|
await merge({ cds: { requires: { 'html5-repo': true } } }).into('mtx/sidecar/package.json')
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
if (addMta || (addApprouter || addWorkzoneStandard || addMultitenancy || addSample) && hasMta) {
|
|
68
|
+
if (addMta || (addXsuaa || addApprouter || addWorkzoneStandard || addMultitenancy || addSample) && hasMta) {
|
|
69
69
|
const srv = srv4(srvPath)
|
|
70
70
|
project.apps = apps
|
|
71
71
|
const relationships = [{
|
|
@@ -109,7 +109,9 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
|
|
|
109
109
|
})
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
// cds10
|
|
113
|
+
// needed because of adding kyma to cli options in case of helm
|
|
114
|
+
if (addContainerize || (addKyma && !addHelm && !addHelmUnifiedRuntime)) {
|
|
113
115
|
const additions = [{
|
|
114
116
|
in: 'modules',
|
|
115
117
|
where: { name: `${project.appName}-html5-deployer` }
|
|
@@ -117,7 +119,7 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
|
|
|
117
119
|
await merge(__dirname, '/files/containerize.yaml.hbs').into('containerize.yaml', { with: project, additions })
|
|
118
120
|
}
|
|
119
121
|
|
|
120
|
-
if (
|
|
122
|
+
if (addKyma) {
|
|
121
123
|
await renderAndCopy(join(__dirname, 'files/html5-deployer.package.json.hbs'), 'app/html5-deployer/package.json', project)
|
|
122
124
|
await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project })
|
|
123
125
|
}
|
|
@@ -24,7 +24,7 @@ module.exports = class IasTemplate extends require('../../plugin') {
|
|
|
24
24
|
|
|
25
25
|
async combine() {
|
|
26
26
|
const project = readProject()
|
|
27
|
-
const { isJava, addMta, hasMta, addCfManifest,
|
|
27
|
+
const { isJava, addMta, hasMta, addCfManifest, addKyma, addMultitenancy, hasApprouter, hasMultitenancy, srvPath } = project
|
|
28
28
|
|
|
29
29
|
if (addMultitenancy) {
|
|
30
30
|
const conf = exists('mtx/sidecar/package.json') ? await read('mtx/sidecar/package.json') : {}
|
|
@@ -63,7 +63,7 @@ module.exports = class IasTemplate extends require('../../plugin') {
|
|
|
63
63
|
await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', { project, additions, overwrites })
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
if (
|
|
66
|
+
if (addKyma) {
|
|
67
67
|
const identity = { in: 'dependencies', where: { 'alias': 'identity' } }
|
|
68
68
|
await merge(__dirname, 'files/Chart.yaml.hbs').into('chart/Chart.yaml', { project, additions: [identity] })
|
|
69
69
|
await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { project })
|
|
@@ -3,6 +3,7 @@ const cds = require('../../../cds')
|
|
|
3
3
|
const { exists, copy, rimraf, fs:{promises:{ mkdtemp }}, path } = cds.utils, { join } = path
|
|
4
4
|
const cmd = require('../../../util/command')
|
|
5
5
|
const mvn = require('../../mvn')
|
|
6
|
+
const { merge } = require('../../merge')
|
|
6
7
|
const { bold, info, link } = require('../../../util/term')
|
|
7
8
|
const { URLS, OPTIONS: { NODEJS, JAVA }, COMMAND_ADD } = require('../../constants')
|
|
8
9
|
const { command, options } = cds.cli
|
|
@@ -33,9 +34,22 @@ module.exports = class JavaTemplate extends require('../../plugin') {
|
|
|
33
34
|
console.log(`using Maven archetype version ${archetypeVersion}`)
|
|
34
35
|
|
|
35
36
|
const temp = await mkdtemp(join(os.tmpdir(), `${path.basename(cds.root)}_`))
|
|
37
|
+
// preserve existing package.json (if any)
|
|
38
|
+
let preservedPackageJsonPath
|
|
39
|
+
if (exists('package.json')) {
|
|
40
|
+
preservedPackageJsonPath = join(temp, 'package.json')
|
|
41
|
+
await copy('package.json').to(preservedPackageJsonPath)
|
|
42
|
+
}
|
|
36
43
|
try {
|
|
37
44
|
await cmd.spawnCommand('mvn', params, { cwd: temp })
|
|
38
45
|
await copy(join(temp, artifactId)).to(cds.root)
|
|
46
|
+
if (preservedPackageJsonPath) {
|
|
47
|
+
// merge template package.json into preserved one
|
|
48
|
+
// (not the other way around)
|
|
49
|
+
// to give preserved values precedence
|
|
50
|
+
await merge('package.json').into(preservedPackageJsonPath)
|
|
51
|
+
await copy(preservedPackageJsonPath).to('package.json')
|
|
52
|
+
}
|
|
39
53
|
} catch (err) {
|
|
40
54
|
if (err.code === 'ENOENT' && err.path === 'mvn') {
|
|
41
55
|
throw `Maven executable 'mvn' not found. Follow ${info(URLS.MAVEN_INSTALL_HELP)} and install Maven on your machine.`
|
|
@@ -4,6 +4,7 @@ const { readProject } = require('../../projectReader')
|
|
|
4
4
|
const { merge } = require('../../merge')
|
|
5
5
|
const { srv4, kafkaMessaging } = require('../../registries/mta')
|
|
6
6
|
const mvn = require('../../mvn')
|
|
7
|
+
const KymaTemplate = require('../kyma')
|
|
7
8
|
|
|
8
9
|
module.exports = class KafkaTemplate extends require('../../plugin') {
|
|
9
10
|
|
|
@@ -28,7 +29,7 @@ module.exports = class KafkaTemplate extends require('../../plugin') {
|
|
|
28
29
|
|
|
29
30
|
async combine() {
|
|
30
31
|
const project = readProject()
|
|
31
|
-
const { addMta, srvPath,
|
|
32
|
+
const { addMta, srvPath, addKyma } = project
|
|
32
33
|
|
|
33
34
|
if (addMta) {
|
|
34
35
|
const srv = srv4(srvPath)
|
|
@@ -42,8 +43,9 @@ module.exports = class KafkaTemplate extends require('../../plugin') {
|
|
|
42
43
|
})
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
if (
|
|
46
|
+
if (addKyma) {
|
|
46
47
|
await merge(__dirname, 'files/values.yaml').into('chart/values.yaml')
|
|
48
|
+
await KymaTemplate.mergeDependency("service-instance", "kafka")
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
}
|