@sap/cds-dk 6.8.2 → 7.0.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/bin/activate.js +15 -7
- package/bin/add.js +29 -15
- package/bin/bind.js +49 -116
- package/bin/build.js +114 -0
- package/bin/cds.js +67 -24
- package/bin/compile/index.js +2 -2
- package/bin/deploy/index.js +46 -39
- package/bin/deploy/to-hana.js +11 -8
- package/bin/deploy/to-postgres.js +8 -2
- package/bin/deploy/to-sqlite.js +0 -1
- package/bin/env.js +75 -41
- package/bin/eval.js +3 -3
- package/bin/extend.js +17 -10
- package/bin/help.js +22 -21
- package/bin/import.js +10 -7
- package/bin/init.js +38 -17
- package/bin/login.js +69 -55
- package/bin/logout.js +12 -9
- package/bin/migrate.js +10 -4
- package/bin/pull.js +12 -5
- package/bin/push.js +24 -13
- package/bin/repl.js +1 -0
- package/bin/run.js +25 -0
- package/bin/subscribe.js +13 -8
- package/bin/unsubscribe.js +15 -8
- package/bin/upgrade.js +15 -9
- package/bin/util/log.js +24 -0
- package/bin/version.js +124 -0
- package/bin/watch.js +1 -35
- package/bin/watched.js +39 -0
- package/lib/bind/KubernetesApiAccessor.js +2 -2
- package/lib/bind/bindingManager.js +1 -1
- package/lib/bind/bindingUtil.js +0 -9
- package/lib/bind/cfKeyProvider.js +10 -72
- package/lib/bind/index.js +114 -0
- package/lib/bind/kubernetesCredentialsProvider.js +2 -2
- package/lib/bind/userCdsrcJsonStorageProvider.js +7 -44
- package/lib/build/buildTaskEngine.js +355 -0
- package/lib/build/buildTaskFactory.js +284 -0
- package/lib/build/buildTaskHandler.js +240 -0
- package/lib/build/buildTaskProvider.js +22 -0
- package/lib/build/buildTaskProviderFactory.js +182 -0
- package/lib/build/constants.js +56 -0
- package/lib/build/index.js +21 -0
- package/lib/build/provider/buildTaskHandlerEdmx.js +83 -0
- package/lib/build/provider/buildTaskHandlerFeatureToggles.js +132 -0
- package/lib/build/provider/buildTaskHandlerInternal.js +228 -0
- package/lib/build/provider/buildTaskProviderInternal.js +370 -0
- package/lib/build/provider/fiori/index.js +167 -0
- package/lib/build/provider/hana/2migration.js +179 -0
- package/lib/build/provider/hana/index.js +522 -0
- package/lib/build/provider/hana/migrationtable.js +472 -0
- package/lib/build/provider/hana/template/.hdiconfig-all +163 -0
- package/lib/build/provider/hana/template/.hdiconfig-cloud +137 -0
- package/lib/build/provider/hana/template/.hdinamespace +4 -0
- package/lib/build/provider/hana/template/package.json +12 -0
- package/lib/build/provider/hana/template/undeploy.json +5 -0
- package/lib/build/provider/java/index.js +93 -0
- package/lib/build/provider/java-cf/index.js +1 -0
- package/lib/build/provider/mtx/index.js +37 -0
- package/lib/build/provider/mtx/resourcesTarBuilder.js +94 -0
- package/lib/build/provider/mtx-extension/index.js +131 -0
- package/lib/build/provider/mtx-sidecar/index.js +138 -0
- package/lib/build/provider/node-cf/index.js +1 -0
- package/lib/build/provider/nodejs/index.js +178 -0
- package/lib/build/util.js +263 -0
- package/lib/cds.js +9 -21
- package/lib/client/auth_manager.js +39 -16
- package/lib/client/helper/dependency_helper.js +7 -6
- package/lib/client/push.js +2 -1
- package/lib/client/settings_manager.js +10 -39
- package/lib/deploy/to-hana/hana.js +273 -0
- package/lib/deploy/to-hana/hdiDeployUtil.js +68 -0
- package/lib/deploy/to-hana/mtaUtil.js +171 -0
- package/lib/import/asyncapi/importAsyncAPI.js +3 -2
- package/lib/import/asyncapi/index.js +5 -2
- package/lib/import/asyncapi/parserContext.js +67 -26
- package/lib/import/asyncapi/utils.js +34 -3
- package/lib/import/common.js +40 -30
- package/lib/import/importapi.js +36 -35
- package/lib/index.js +12 -17
- package/lib/init/constants.js +36 -71
- package/lib/init/index.js +18 -52
- package/lib/init/template/_merging/registry-mta.js +21 -3
- package/lib/init/template/approuter/files/mta.yaml.hbs +29 -29
- package/lib/init/template/approuter/files/values.yaml.hbs +5 -5
- package/lib/init/template/approuter/files/xs-app.json.hbs +8 -2
- package/lib/init/template/approuter/index.js +7 -8
- package/lib/init/template/auditlog/files/mta.yaml.hbs +5 -5
- package/lib/init/template/auditlog/files/package.json.hbs +13 -13
- package/lib/init/template/auditlog/index.js +3 -3
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +22 -22
- package/lib/init/template/cf-manifest/files/services-manifest.yml.hbs +3 -3
- package/lib/init/template/connectivity/files/mta.yaml.hbs +14 -0
- package/lib/init/template/connectivity/files/package.json.hbs +17 -0
- package/lib/init/template/connectivity/index.js +21 -4
- package/lib/init/template/data/index.js +5 -1
- package/lib/init/template/destination/files/mta.yaml.hbs +14 -0
- package/lib/init/template/destination/files/package.json.hbs +17 -0
- package/lib/init/template/{destinations → destination}/index.js +19 -13
- package/lib/init/template/enterprise-messaging/files/event-mesh.json.hbs +3 -3
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/enterprise-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/enterprise-messaging/files/xs-security.json.hbs +19 -0
- package/lib/init/template/enterprise-messaging/index.js +27 -6
- package/lib/init/template/enterprise-messaging-shared/files/event-mesh.json.hbs +3 -3
- package/lib/init/template/enterprise-messaging-shared/files/mta.yaml.hbs +5 -5
- package/lib/init/template/enterprise-messaging-shared/files/package.json.hbs +9 -9
- package/lib/init/template/enterprise-messaging-shared/index.js +4 -5
- package/lib/init/template/extensibility/files/package.json.hbs +10 -10
- package/lib/init/template/extensibility/index.js +8 -9
- package/lib/init/template/file-based-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/file-based-messaging/index.js +3 -4
- package/lib/init/template/hana/files/db/package.json +1 -1
- package/lib/init/template/hana/files/mta.yaml.hbs +21 -21
- package/lib/init/template/hana/files/package.json.hbs +16 -22
- package/lib/init/template/hana/files/values.yaml.hbs +1 -1
- package/lib/init/template/hana/index.js +5 -15
- package/lib/init/template/helm/files/Chart.yaml.hbs +4 -4
- package/lib/init/template/helm/files/values.yaml.hbs +6 -6
- package/lib/init/template/helm/index.js +5 -10
- package/lib/init/template/helm/subcharts/content-deployment/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/content-deployment/templates/_helpers.tpl +37 -31
- package/lib/init/template/helm/subcharts/content-deployment/templates/job.yaml +13 -14
- package/lib/init/template/helm/subcharts/content-deployment/templates/secret.yaml +2 -2
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-account.yaml +1 -1
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-binding.yaml +3 -3
- package/lib/init/template/helm/subcharts/content-deployment/values.md +116 -116
- package/lib/init/template/helm/subcharts/service-instance/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/service-instance/templates/_helpers.tpl +9 -9
- package/lib/init/template/helm/subcharts/service-instance/templates/serviceinstance.yaml +2 -2
- package/lib/init/template/helm/subcharts/service-instance/values.md +15 -15
- package/lib/init/template/helm/subcharts/web-application/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/web-application/templates/NOTES.txt +15 -0
- package/lib/init/template/helm/subcharts/web-application/templates/_helpers.tpl +23 -23
- package/lib/init/template/helm/subcharts/web-application/templates/api-rule.yaml +4 -4
- package/lib/init/template/helm/subcharts/web-application/templates/deployment.yaml +17 -17
- package/lib/init/template/helm/subcharts/web-application/templates/network-policy.yaml +24 -3
- package/lib/init/template/helm/subcharts/web-application/templates/pod-disruption-budget.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/templates/secret.yaml +2 -2
- package/lib/init/template/helm/subcharts/web-application/templates/service-account.yaml +1 -1
- package/lib/init/template/helm/subcharts/web-application/templates/service-binding.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/templates/service.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/values.md +141 -123
- package/lib/init/template/helm/subcharts/web-application/values.schema.json +7 -0
- package/lib/init/template/helm/subcharts/web-application/values.yaml +1 -0
- package/lib/init/template/html5-repo/index.js +4 -5
- package/lib/init/template/java/index.js +5 -5
- package/lib/init/template/kibana-logging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/kibana-logging/files/package.json.hbs +9 -9
- package/lib/init/template/kibana-logging/index.js +3 -4
- package/lib/init/template/lint/index.js +3 -3
- package/lib/init/template/mta/files/mta.yaml.hbs +14 -14
- package/lib/init/template/mta/files/package.json +5 -0
- package/lib/init/template/mta/index.js +12 -13
- package/lib/init/template/mtx/index.js +2 -2
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +29 -27
- package/lib/init/template/multitenancy/files/package.json.hbs +17 -14
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +7 -7
- package/lib/init/template/multitenancy/files/values.yaml.hbs +19 -19
- package/lib/init/template/multitenancy/index.js +14 -16
- package/lib/init/template/nodejs/files/package.json.hbs +1 -1
- package/lib/init/template/nodejs/index.js +5 -8
- package/lib/init/template/redis-messaging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/redis-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/redis-messaging/index.js +4 -5
- package/lib/init/template/sample/files/app/_i18n/i18n.properties +43 -0
- package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +14 -0
- package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +114 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +8 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +11 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +129 -0
- package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +57 -0
- package/lib/init/template/sample/files/app/common.cds +263 -0
- package/lib/init/template/sample/files/app/index.html +30 -0
- package/lib/init/template/sample/files/app/services.cds +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +6 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books_texts.csv +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +16 -0
- package/lib/init/template/sample/files/db/schema.cds +31 -0
- package/lib/init/template/sample/files/nodejs/admin-service.js +12 -0
- package/lib/init/template/sample/files/nodejs/cat-service.js +26 -0
- package/lib/init/template/sample/files/srv/admin-service.cds +5 -0
- package/lib/init/template/sample/files/srv/cat-service.cds +16 -0
- package/lib/init/template/sample/index.js +24 -0
- package/lib/init/template/sample-tiny/index.js +39 -0
- package/lib/init/template/samples/index.js +5 -56
- package/lib/init/template/sqlite/files/package.json.hbs +13 -13
- package/lib/init/template/sqlite/index.js +2 -2
- package/lib/init/template/templateBase.js +24 -1
- package/lib/init/template/toggles/files/package.json.hbs +10 -10
- package/lib/init/template/toggles/index.js +3 -3
- package/lib/init/template/typer/files/gitignore +1 -0
- package/lib/init/template/typer/files/package.json +8 -0
- package/lib/init/template/typer/files/xsconfig.json +9 -0
- package/lib/init/template/typer/index.js +36 -0
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +12 -12
- package/lib/init/template/xsuaa/files/package.json.hbs +13 -13
- package/lib/init/template/xsuaa/files/values.yaml.hbs +8 -8
- package/lib/init/template/xsuaa/index.js +8 -19
- package/lib/init/util/merge.js +73 -59
- package/lib/init/util/mvn.js +21 -17
- package/lib/init/util/projectReader.js +49 -87
- package/lib/init/util/xml.js +14 -23
- package/lib/util/cfUtil.js +366 -0
- package/lib/util/command.js +3 -3
- package/lib/util/gitUtil.js +55 -0
- package/lib/util/version.js +27 -0
- package/npm-shrinkwrap.json +339 -277
- package/package.json +6 -6
- package/CHANGELOG.md +0 -1453
- package/bin/build/all.js +0 -88
- package/bin/build/index.js +0 -82
- package/lib/compile/index.js +0 -14
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/db/data/my.bookshop-Books.csv +0 -0
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/db/data-model.cds +0 -0
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/srv/cat-service.cds.hbs +0 -0
|
@@ -6,8 +6,7 @@ const { mergeJSON } = require('../../util/merge')
|
|
|
6
6
|
module.exports = class FileBasedMessagingTemplate extends require('../templateBase') {
|
|
7
7
|
|
|
8
8
|
async canRun() {
|
|
9
|
-
const
|
|
10
|
-
const { isJava } = projectDescriptor.cap
|
|
9
|
+
const { isJava } = await readProject(this.options)
|
|
11
10
|
if (isJava) throw `'cds add file-based-messaging' is not available for Java yet`
|
|
12
11
|
return true
|
|
13
12
|
}
|
|
@@ -18,8 +17,8 @@ module.exports = class FileBasedMessagingTemplate extends require('../templateBa
|
|
|
18
17
|
|
|
19
18
|
async run() {
|
|
20
19
|
const projectDescriptor = await readProject(this.options)
|
|
21
|
-
const { configFile } = projectDescriptor
|
|
22
|
-
projectDescriptor.
|
|
20
|
+
const { configFile } = projectDescriptor
|
|
21
|
+
projectDescriptor.shortcut = !(await read(configFile)).cds?.requires?.messaging?.kind
|
|
23
22
|
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), projectDescriptor)
|
|
24
23
|
}
|
|
25
24
|
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
---
|
|
2
2
|
modules:
|
|
3
|
-
- name: {{
|
|
4
|
-
type: {{
|
|
5
|
-
path: {{&
|
|
3
|
+
- name: {{appName}}-srv
|
|
4
|
+
type: {{language}}
|
|
5
|
+
path: {{& srvPath}}
|
|
6
6
|
requires:
|
|
7
|
-
- name: {{
|
|
7
|
+
- name: {{appName}}-db
|
|
8
8
|
|
|
9
|
-
{{^
|
|
10
|
-
- name: {{
|
|
9
|
+
{{^isMultitenant}}
|
|
10
|
+
- name: {{appName}}-db-deployer
|
|
11
11
|
type: hdb
|
|
12
|
-
path: {{&
|
|
12
|
+
path: {{& db.0.path}}
|
|
13
13
|
parameters:
|
|
14
14
|
buildpack: nodejs_buildpack
|
|
15
|
-
{{#
|
|
15
|
+
{{#isJava}}
|
|
16
16
|
build-parameters:
|
|
17
17
|
builder: custom
|
|
18
18
|
commands:
|
|
19
19
|
- npm run build
|
|
20
|
-
{{/
|
|
20
|
+
{{/isJava}}
|
|
21
21
|
requires:
|
|
22
|
-
- name: {{
|
|
23
|
-
{{/
|
|
22
|
+
- name: {{appName}}-db
|
|
23
|
+
{{/isMultitenant}}
|
|
24
24
|
|
|
25
|
-
{{#
|
|
26
|
-
- name: {{
|
|
25
|
+
{{#isMultitenant}}
|
|
26
|
+
- name: {{appName}}-mtx
|
|
27
27
|
type: nodejs
|
|
28
|
-
path: {{#
|
|
28
|
+
path: {{#isNodejs}}gen/{{/isNodejs}}mtx/sidecar
|
|
29
29
|
requires:
|
|
30
|
-
- name: {{
|
|
31
|
-
{{/
|
|
30
|
+
- name: {{appName}}-db
|
|
31
|
+
{{/isMultitenant}}
|
|
32
32
|
|
|
33
33
|
resources:
|
|
34
|
-
- name: {{
|
|
35
|
-
{{^
|
|
34
|
+
- name: {{appName}}-db
|
|
35
|
+
{{^isMultitenant}}
|
|
36
36
|
type: com.sap.xs.hdi-container
|
|
37
37
|
parameters:
|
|
38
38
|
service: hana
|
|
39
39
|
service-plan: hdi-shared
|
|
40
|
-
{{/
|
|
41
|
-
{{#
|
|
40
|
+
{{/isMultitenant}}
|
|
41
|
+
{{#isMultitenant}}
|
|
42
42
|
type: org.cloudfoundry.managed-service
|
|
43
43
|
parameters:
|
|
44
44
|
service: service-manager
|
|
45
45
|
service-plan: container
|
|
46
|
-
{{/
|
|
46
|
+
{{/isMultitenant}}
|
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
{{#
|
|
2
|
+
{{#isNodejs}}
|
|
3
3
|
"dependencies": {
|
|
4
|
-
|
|
4
|
+
"@sap/cds-hana": "^2"
|
|
5
5
|
},
|
|
6
6
|
"cds": {
|
|
7
|
-
{{/
|
|
7
|
+
{{/isNodejs}}
|
|
8
8
|
"requires": {
|
|
9
|
-
{{#
|
|
10
|
-
"[{{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
{{#profile}}
|
|
10
|
+
"[{{profile}}]": {
|
|
11
|
+
{{/profile}}
|
|
12
|
+
{{#shortcut}}
|
|
13
|
+
"db": "hana"
|
|
14
|
+
{{/shortcut}}
|
|
15
|
+
{{^shortcut}}
|
|
15
16
|
"db": {
|
|
16
|
-
"kind": "hana
|
|
17
|
+
"kind": "hana"
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
{{/cap.for}}
|
|
21
|
-
{{#cap.shortcut}}
|
|
22
|
-
"db": "{{^cap.for}}hana-cloud{{/cap.for}}{{#cap.for}}sql{{/cap.for}}"
|
|
23
|
-
{{/cap.shortcut}}
|
|
24
|
-
{{^cap.shortcut}}
|
|
25
|
-
"db": {
|
|
26
|
-
"kind": "sql"
|
|
19
|
+
{{/shortcut}}
|
|
20
|
+
{{#profile}}
|
|
27
21
|
}
|
|
28
|
-
{{/
|
|
22
|
+
{{/profile}}
|
|
29
23
|
}
|
|
30
|
-
{{#
|
|
24
|
+
{{#isNodejs}}
|
|
31
25
|
}
|
|
32
|
-
{{/
|
|
26
|
+
{{/isNodejs}}
|
|
33
27
|
}
|
|
@@ -9,7 +9,7 @@ const { parseMd5File, writeMd5File } = require('../../util/md5')
|
|
|
9
9
|
const { copyFiles } = require('../../util/template')
|
|
10
10
|
const { readProject } = require('../../util/projectReader');
|
|
11
11
|
|
|
12
|
-
const {
|
|
12
|
+
const { OPTIONS: { JAVA }, URLS } = require('../../constants');
|
|
13
13
|
|
|
14
14
|
const { srvNode4, srvJava4, hdbDeployer, serviceManager, hdiContainer, mtxSidecar4 } = require('../_merging/registry-mta');
|
|
15
15
|
|
|
@@ -19,20 +19,10 @@ module.exports = class HanaTemplate extends require('../templateBase') {
|
|
|
19
19
|
return env.requires?.db?.kind === 'hana'
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
// REVISIT: Remove with CDS 7
|
|
23
|
-
async canRun() {
|
|
24
|
-
const cds = require('../../../cds')
|
|
25
|
-
const [major, minor] = cds.version.split('.').map(Number)
|
|
26
|
-
if (major < 5 || major === 5 && minor < 9) {
|
|
27
|
-
cds.error('The added configuration requires @sap/cds 5.9.0 or higher. Please update @sap/cds to the latest version and run \x1b[1mcds add hana\x1b[0m again.')
|
|
28
|
-
}
|
|
29
|
-
return true
|
|
30
|
-
}
|
|
31
|
-
|
|
32
22
|
async run() {
|
|
33
23
|
const projectDescriptor = await readProject(this.options)
|
|
34
|
-
const { isJava, configFile } = projectDescriptor
|
|
35
|
-
projectDescriptor.
|
|
24
|
+
const { isJava, configFile } = projectDescriptor
|
|
25
|
+
projectDescriptor.shortcut = !(await read(configFile)).cds?.requires?.db?.kind
|
|
36
26
|
|
|
37
27
|
const env = await this.getEnv() // REVISIT: Get info from projectDescriptor
|
|
38
28
|
|
|
@@ -77,7 +67,7 @@ module.exports = class HanaTemplate extends require('../templateBase') {
|
|
|
77
67
|
|
|
78
68
|
async runDependentMerging(context = {}) {
|
|
79
69
|
const projectDescriptor = await readProject(this.options)
|
|
80
|
-
const { hasMta, hasHelm, hasHtml5Repo, isJava, isMultitenant, srvPath } = projectDescriptor
|
|
70
|
+
const { hasMta, hasHelm, hasHtml5Repo, isJava, isMultitenant, srvPath } = projectDescriptor
|
|
81
71
|
|
|
82
72
|
|
|
83
73
|
if (hasMta) {
|
|
@@ -205,7 +195,7 @@ module.exports = class HanaTemplate extends require('../templateBase') {
|
|
|
205
195
|
|
|
206
196
|
async _updatePomXml() {
|
|
207
197
|
// if called during cds init the project generation call to AT will add settings
|
|
208
|
-
if (!this.options.add.has(
|
|
198
|
+
if (!this.options.add.has(JAVA)) {
|
|
209
199
|
const mvnAddHanaArgs = mvnArchetypes.getAddHanaCmdArgs(this.options);
|
|
210
200
|
try {
|
|
211
201
|
await commandUtil.spawnCommand('mvn', mvnAddHanaArgs, {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
#
|
|
3
3
|
# This file is generated by "cds add helm"
|
|
4
4
|
apiVersion: v2
|
|
5
|
-
name: {{
|
|
6
|
-
description: {{
|
|
5
|
+
name: {{appName}}
|
|
6
|
+
description: {{appDescription}}
|
|
7
7
|
type: application
|
|
8
|
-
version: {{
|
|
9
|
-
appVersion: {{
|
|
8
|
+
version: {{appVersion}}
|
|
9
|
+
appVersion: {{appVersion}}
|
|
10
10
|
|
|
@@ -5,20 +5,20 @@ global:
|
|
|
5
5
|
srv:
|
|
6
6
|
bindings: {}
|
|
7
7
|
image:
|
|
8
|
-
repository: <your-container-registry>/{{
|
|
8
|
+
repository: <your-container-registry>/{{appName}}-srv
|
|
9
9
|
tag: latest
|
|
10
|
-
{{#
|
|
10
|
+
{{#isJava}}
|
|
11
11
|
env:
|
|
12
12
|
SPRING_PROFILES_ACTIVE: cloud
|
|
13
|
-
{{/
|
|
13
|
+
{{/isJava}}
|
|
14
14
|
resources:
|
|
15
15
|
limits:
|
|
16
16
|
ephemeral-storage: 1G
|
|
17
|
-
memory: {{#
|
|
17
|
+
memory: {{#isJava}}1G{{/isJava}}{{^isJava}}500M{{/isJava}}
|
|
18
18
|
requests:
|
|
19
19
|
ephemeral-storage: 1G
|
|
20
|
-
cpu: {{#
|
|
21
|
-
memory: {{#
|
|
20
|
+
cpu: {{#isJava}}1000m{{/isJava}}{{^isJava}}500m{{/isJava}}
|
|
21
|
+
memory: {{#isJava}}1G{{/isJava}}{{^isJava}}500M{{/isJava}}
|
|
22
22
|
health:
|
|
23
23
|
liveness:
|
|
24
24
|
path: /
|
|
@@ -5,12 +5,17 @@ const { mergeYAML } = require('../../util/merge')
|
|
|
5
5
|
const { parseMd5File, writeMd5File, copyAndTrack } = require('../../util/md5')
|
|
6
6
|
|
|
7
7
|
module.exports = class HelmTemplate extends require('../templateBase') {
|
|
8
|
+
|
|
8
9
|
constructor(generator, oldTrackingData = undefined, newTrackingData = {}) {
|
|
9
10
|
super(generator)
|
|
10
11
|
this.oldTrackingData = oldTrackingData;
|
|
11
12
|
this.newTrackingData = newTrackingData;
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
getRelatedFacets() {
|
|
16
|
+
return ['hana', 'xsuaa', 'auditlog', 'enterprise-messaging', 'destination' , 'multitenancy', 'extensibility', 'approuter', 'connectivity']
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
static hasFacet(_, options) {
|
|
15
20
|
// REVISIT: this works, but could be semantically nicer with a 'shouldRunDependentMerging' or the like
|
|
16
21
|
if (options?.add.has('mta') && !options?.add.has('helm')) return false
|
|
@@ -98,14 +103,4 @@ module.exports = class HelmTemplate extends require('../templateBase') {
|
|
|
98
103
|
await this.runDependentMerging();
|
|
99
104
|
await writeMd5File(join('chart', '.cds-add-helm-files.md5'), this.newTrackingData);
|
|
100
105
|
}
|
|
101
|
-
|
|
102
|
-
async runDependentMerging() {
|
|
103
|
-
// Re-applying the dependent merging part of other facets if necessary.
|
|
104
|
-
const dependentFacets = ['hana', 'xsuaa', 'auditlog', 'enterprise-messaging', 'destinations' , 'multitenancy', 'extensibility', 'approuter']
|
|
105
|
-
for (const facet of dependentFacets) {
|
|
106
|
-
const Template = require('../'+facet)
|
|
107
|
-
const template = new Template(this.generator)
|
|
108
|
-
if (Template.hasFacet(await this.getEnv(), this.options)) await template.runDependentMerging(this)
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
106
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{{/*
|
|
2
2
|
Expand the name of the chart.
|
|
3
3
|
*/}}
|
|
4
|
-
{{- define "content-deployment.name" -}}
|
|
4
|
+
{{- define "content-deployment.internal.name" -}}
|
|
5
5
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
|
6
6
|
{{- end }}
|
|
7
7
|
|
|
@@ -10,47 +10,53 @@ Create a default fully qualified app name.
|
|
|
10
10
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
11
11
|
If release name contains chart name it will be used as a full name.
|
|
12
12
|
*/}}
|
|
13
|
-
{{- define "content-deployment.fullname" -}}
|
|
14
|
-
{{- if .Values.fullnameOverride }}
|
|
15
|
-
{{- .Values.fullnameOverride
|
|
16
|
-
{{-
|
|
17
|
-
{{-
|
|
18
|
-
{{-
|
|
19
|
-
{{-
|
|
20
|
-
{{-
|
|
21
|
-
{{-
|
|
22
|
-
{{-
|
|
23
|
-
{{- end }}
|
|
13
|
+
{{- define "content-deployment.internal.fullname" -}}
|
|
14
|
+
{{- if .Values.fullnameOverride }}
|
|
15
|
+
{{- if gt (len .Values.fullnameOverride) 63 }}
|
|
16
|
+
{{- fail (printf "name exceeds 63 characters: '%s'" .Values.fullnameOverride) }}
|
|
17
|
+
{{- end }}
|
|
18
|
+
{{- .Values.fullnameOverride }}
|
|
19
|
+
{{- else }}
|
|
20
|
+
{{- $name := default .Chart.Name .Values.nameOverride }}
|
|
21
|
+
{{- if not (eq .Release.Name $name)}}
|
|
22
|
+
{{- $name = printf "%s-%s" .Release.Name $name }}
|
|
23
|
+
{{- end }}
|
|
24
|
+
{{- if gt (len $name) 63 }}
|
|
25
|
+
{{- fail (printf "name exceeds 63 characters: '%s'" $name) }}
|
|
26
|
+
{{- end }}
|
|
27
|
+
{{- $name }}
|
|
28
|
+
{{- end }}
|
|
24
29
|
{{- end }}
|
|
25
30
|
|
|
26
31
|
{{/*
|
|
27
32
|
Define a name for the Job object
|
|
28
33
|
*/}}
|
|
29
|
-
{{- define "content-deployment.jobName" -}}
|
|
30
|
-
{{- printf "%s-%04d" ((include "content-deployment.fullname" . ) | trunc 59) (mod .Release.Revision 1000) }}
|
|
34
|
+
{{- define "content-deployment.internal.jobName" -}}
|
|
35
|
+
{{- printf "%s-%04d" ((include "content-deployment.internal.fullname" . ) | trunc 59) (mod .Release.Revision 1000) }}
|
|
31
36
|
{{- end }}
|
|
32
37
|
|
|
33
38
|
{{/*
|
|
34
39
|
Define a name for a ServiceBinding object
|
|
35
40
|
*/}}
|
|
36
|
-
{{- define "content-deployment.bindingName" -}}
|
|
37
|
-
{{- printf "%s-%s" (include "content-deployment.fullname" .root ) .name }}
|
|
41
|
+
{{- define "content-deployment.internal.bindingName" -}}
|
|
42
|
+
{{- printf "%s-%s" (include "content-deployment.internal.fullname" .root ) .name }}
|
|
38
43
|
{{- end }}
|
|
39
44
|
|
|
40
45
|
{{/*
|
|
41
46
|
Create chart name and version as used by the chart label.
|
|
42
47
|
*/}}
|
|
43
|
-
{{- define "content-deployment.chart" -}}
|
|
48
|
+
{{- define "content-deployment.internal.chart" -}}
|
|
44
49
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
|
45
50
|
{{- end }}
|
|
46
51
|
|
|
47
52
|
{{/*
|
|
48
53
|
Common labels
|
|
49
54
|
*/}}
|
|
50
|
-
{{- define "content-deployment.labels" -}}
|
|
55
|
+
{{- define "content-deployment.internal.labels" -}}
|
|
56
|
+
sidecar.istio.io/inject: "false"
|
|
51
57
|
helm.sh/revision: {{ .Release.Revision | quote }}
|
|
52
|
-
helm.sh/chart: {{ include "content-deployment.chart" . }}
|
|
53
|
-
{{ include "content-deployment.selectorLabels" . }}
|
|
58
|
+
helm.sh/chart: {{ include "content-deployment.internal.chart" . }}
|
|
59
|
+
{{ include "content-deployment.internal.selectorLabels" . }}
|
|
54
60
|
{{- if .Chart.AppVersion }}
|
|
55
61
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
56
62
|
{{- end }}
|
|
@@ -59,9 +65,9 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
|
59
65
|
{{/*
|
|
60
66
|
Selector labels
|
|
61
67
|
*/}}
|
|
62
|
-
{{- define "content-deployment.selectorLabels" -}}
|
|
68
|
+
{{- define "content-deployment.internal.selectorLabels" -}}
|
|
63
69
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
64
|
-
app.kubernetes.io/name: {{ include "content-deployment.name" . }}
|
|
70
|
+
app.kubernetes.io/name: {{ include "content-deployment.internal.name" . }}
|
|
65
71
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
66
72
|
{{- if .Values.global}}
|
|
67
73
|
{{- if .Values.global.component }}
|
|
@@ -76,7 +82,7 @@ app.kubernetes.io/partOf: {{ .Values.global.partOf }}
|
|
|
76
82
|
{{/*
|
|
77
83
|
Service Binding secret mounts
|
|
78
84
|
*/}}
|
|
79
|
-
{{- define "content-deployment.serviceMounts" -}}
|
|
85
|
+
{{- define "content-deployment.internal.serviceMounts" -}}
|
|
80
86
|
{{- range $name, $params := .Values.bindings }}
|
|
81
87
|
- mountPath: /bindings/{{ $name }}/
|
|
82
88
|
name: {{ $name }}-binding
|
|
@@ -87,9 +93,9 @@ Service Binding secret mounts
|
|
|
87
93
|
{{/*
|
|
88
94
|
Service Binding secret volumes
|
|
89
95
|
*/}}
|
|
90
|
-
{{- define "content-deployment.serviceVolumes" -}}
|
|
96
|
+
{{- define "content-deployment.internal.serviceVolumes" -}}
|
|
91
97
|
{{- range $name, $params := .Values.bindings }}
|
|
92
|
-
{{- $secretName := (include "content-deployment.bindingName" (dict "root" $ "name" $name)) }}
|
|
98
|
+
{{- $secretName := (include "content-deployment.internal.bindingName" (dict "root" $ "name" $name)) }}
|
|
93
99
|
{{- if $params.fromSecret }}
|
|
94
100
|
{{- $secretName = $params.fromSecret}}
|
|
95
101
|
{{- else if $params.secretName }}
|
|
@@ -104,21 +110,21 @@ Service Binding secret volumes
|
|
|
104
110
|
{{/*
|
|
105
111
|
Name of the imagePullSecret
|
|
106
112
|
*/}}
|
|
107
|
-
{{- define "content-deployment.imagePullSecretName" -}}
|
|
113
|
+
{{- define "content-deployment.internal.imagePullSecretName" -}}
|
|
108
114
|
{{ $ips := (dict "local" .Values.imagePullSecret "global" .Values.global.imagePullSecret) }}
|
|
109
115
|
{{- if $ips.local.name }}
|
|
110
116
|
{{- $ips.local.name }}
|
|
111
117
|
{{- else if $ips.global.name }}
|
|
112
118
|
{{- $ips.global.name }}
|
|
113
119
|
{{- else if or $ips.local.dockerconfigjson $ips.global.dockerconfigjson }}
|
|
114
|
-
{{- include "content-deployment.fullname" . }}
|
|
120
|
+
{{- include "content-deployment.internal.fullname" . }}
|
|
115
121
|
{{- end }}
|
|
116
122
|
{{- end }}
|
|
117
123
|
|
|
118
124
|
{{/*
|
|
119
125
|
Calculate the final image name
|
|
120
126
|
*/}}
|
|
121
|
-
{{- define "content-deployment.imageName" -}}
|
|
127
|
+
{{- define "content-deployment.internal.imageName" -}}
|
|
122
128
|
{{- $tag := .Values.image.tag | default .Values.global.image.tag | default "latest" }}
|
|
123
129
|
{{- $registry := .Values.image.registry | default .Values.global.image.registry }}
|
|
124
130
|
{{- if $registry }}
|
|
@@ -133,7 +139,7 @@ Create the name of a service instance.
|
|
|
133
139
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
134
140
|
If release name contains chart name it will be used as service instance name.
|
|
135
141
|
*/}}
|
|
136
|
-
{{- define "content-deployment.serviceInstanceName" -}}
|
|
142
|
+
{{- define "content-deployment.internal.serviceInstanceName" -}}
|
|
137
143
|
{{- $name := "" }}
|
|
138
144
|
{{- if .binding.serviceInstanceFullname }}
|
|
139
145
|
{{- if gt (len .binding.serviceInstanceFullname) 63 }}
|
|
@@ -152,7 +158,7 @@ If release name contains chart name it will be used as service instance name.
|
|
|
152
158
|
{{- tpl $name .root }}
|
|
153
159
|
{{- end }}
|
|
154
160
|
|
|
155
|
-
{{- define "content-deployment.processEnv" -}}
|
|
161
|
+
{{- define "content-deployment.internal.processEnv" -}}
|
|
156
162
|
{{- $result := dict }}
|
|
157
163
|
{{- $variables := list }}
|
|
158
164
|
{{- range $k, $v := .Values.env }}
|
|
@@ -178,7 +184,7 @@ If release name contains chart name it will be used as service instance name.
|
|
|
178
184
|
{{- (fromYaml (tpl (toYaml $result) $)) | mustToJson }}
|
|
179
185
|
{{- end }}
|
|
180
186
|
|
|
181
|
-
{{- define "content-deployment.processEnvFrom" -}}
|
|
187
|
+
{{- define "content-deployment.internal.processEnvFrom" -}}
|
|
182
188
|
{{- $result := dict }}
|
|
183
189
|
{{- $variables := list }}
|
|
184
190
|
{{- range $secretName := .Values.envSecretNames }}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
apiVersion: batch/v1
|
|
3
3
|
kind: Job
|
|
4
4
|
metadata:
|
|
5
|
-
labels: {{- include "content-deployment.labels" . | nindent 4 }}
|
|
6
|
-
name: {{ include "content-deployment.jobName" . }}
|
|
5
|
+
labels: {{- include "content-deployment.internal.labels" . | nindent 4 }}
|
|
6
|
+
name: {{ include "content-deployment.internal.jobName" . }}
|
|
7
7
|
spec:
|
|
8
8
|
completions: 1
|
|
9
9
|
manualSelector: false
|
|
@@ -11,20 +11,19 @@ spec:
|
|
|
11
11
|
ttlSecondsAfterFinished: {{ mul .Values.ttlDaysAfterFinished 24 60 60 }}
|
|
12
12
|
template:
|
|
13
13
|
metadata:
|
|
14
|
-
labels: {{- include "content-deployment.labels" . | nindent 8 }}
|
|
14
|
+
labels: {{- include "content-deployment.internal.labels" . | nindent 8 }}
|
|
15
15
|
annotations:
|
|
16
|
-
|
|
17
|
-
container.apparmor.security.beta.kubernetes.io/{{ include "content-deployment.name" . }}: runtime/default
|
|
16
|
+
container.apparmor.security.beta.kubernetes.io/{{ include "content-deployment.internal.name" . }}: runtime/default
|
|
18
17
|
spec:
|
|
19
|
-
{{- if (include "content-deployment.imagePullSecretName" .) }}
|
|
18
|
+
{{- if (include "content-deployment.internal.imagePullSecretName" .) }}
|
|
20
19
|
imagePullSecrets:
|
|
21
|
-
- name: {{ include "content-deployment.imagePullSecretName" . }}
|
|
20
|
+
- name: {{ include "content-deployment.internal.imagePullSecretName" . }}
|
|
22
21
|
{{- end }}
|
|
23
22
|
automountServiceAccountToken: false
|
|
24
|
-
serviceAccountName: {{ tpl (.Values.serviceAccountName | default (include "content-deployment.fullname" .)) $ }}
|
|
23
|
+
serviceAccountName: {{ tpl (.Values.serviceAccountName | default (include "content-deployment.internal.fullname" .)) $ }}
|
|
25
24
|
containers:
|
|
26
|
-
- image: {{ include "content-deployment.imageName" . }}
|
|
27
|
-
name: {{ include "content-deployment.name" . }}
|
|
25
|
+
- image: {{ include "content-deployment.internal.imageName" . }}
|
|
26
|
+
name: {{ include "content-deployment.internal.name" . }}
|
|
28
27
|
env:
|
|
29
28
|
- name: EXIT
|
|
30
29
|
value: "1"
|
|
@@ -34,12 +33,12 @@ spec:
|
|
|
34
33
|
value: /tmp
|
|
35
34
|
- name: SERVICE_BINDING_ROOT
|
|
36
35
|
value: /bindings
|
|
37
|
-
{{- $envVars := (include "content-deployment.processEnv" $ | fromJson) }}
|
|
36
|
+
{{- $envVars := (include "content-deployment.internal.processEnv" $ | fromJson) }}
|
|
38
37
|
{{- if not (eq (len $envVars.vars) 0) }}
|
|
39
38
|
{{- $envVars.vars | toYaml | nindent 8}}
|
|
40
39
|
{{- end }}
|
|
41
40
|
envFrom:
|
|
42
|
-
{{- $envFromVars := (include "content-deployment.processEnvFrom" . | fromJson) }}
|
|
41
|
+
{{- $envFromVars := (include "content-deployment.internal.processEnvFrom" . | fromJson) }}
|
|
43
42
|
{{- if not (eq (len $envFromVars.vars) 0) }}
|
|
44
43
|
{{- $envFromVars.vars | toYaml | nindent 8}}
|
|
45
44
|
{{- end }}
|
|
@@ -55,7 +54,7 @@ spec:
|
|
|
55
54
|
volumeMounts:
|
|
56
55
|
- mountPath: /tmp
|
|
57
56
|
name: tmp
|
|
58
|
-
{{- include "content-deployment.serviceMounts" . | nindent 8 }}
|
|
57
|
+
{{- include "content-deployment.internal.serviceMounts" . | nindent 8 }}
|
|
59
58
|
restartPolicy: OnFailure
|
|
60
59
|
securityContext:
|
|
61
60
|
runAsNonRoot: true
|
|
@@ -63,4 +62,4 @@ spec:
|
|
|
63
62
|
volumes:
|
|
64
63
|
- name: tmp
|
|
65
64
|
emptyDir: {}
|
|
66
|
-
{{- include "content-deployment.serviceVolumes" . | nindent 6 }}
|
|
65
|
+
{{- include "content-deployment.internal.serviceVolumes" . | nindent 6 }}
|
|
@@ -3,8 +3,8 @@ apiVersion: v1
|
|
|
3
3
|
kind: Secret
|
|
4
4
|
type: kubernetes.io/dockerconfigjson
|
|
5
5
|
metadata:
|
|
6
|
-
name: {{ include "content-deployment.imagePullSecretName" . }}
|
|
7
|
-
labels: {{- include "content-deployment.labels" . | nindent 4 }}
|
|
6
|
+
name: {{ include "content-deployment.internal.imagePullSecretName" . }}
|
|
7
|
+
labels: {{- include "content-deployment.internal.labels" . | nindent 4 }}
|
|
8
8
|
data:
|
|
9
9
|
.dockerconfigjson: {{ default .Values.global.imagePullSecret.dockerconfigjson .Values.imagePullSecret.dockerconfigjson }}
|
|
10
10
|
{{- end -}}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
apiVersion: services.cloud.sap.com/v1
|
|
5
5
|
kind: ServiceBinding
|
|
6
6
|
metadata:
|
|
7
|
-
name: {{ include "content-deployment.bindingName" (dict "root" $ "name" $name) }}
|
|
8
|
-
labels: {{- include "content-deployment.labels" $ | nindent 4 }}
|
|
7
|
+
name: {{ include "content-deployment.internal.bindingName" (dict "root" $ "name" $name) }}
|
|
8
|
+
labels: {{- include "content-deployment.internal.labels" $ | nindent 4 }}
|
|
9
9
|
spec:
|
|
10
|
-
serviceInstanceName: {{include "content-deployment.serviceInstanceName" (dict "binding" $params "root" $) }}
|
|
10
|
+
serviceInstanceName: {{include "content-deployment.internal.serviceInstanceName" (dict "binding" $params "root" $) }}
|
|
11
11
|
secretKey: credentials
|
|
12
12
|
{{- if $params.externalName }}
|
|
13
13
|
externalName: {{ $params.externalName }}
|