@sap/cds-dk 7.4.0 → 7.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/activate.js +1 -1
- package/bin/add.js +6 -4
- package/bin/build.js +10 -12
- package/bin/cds.js +4 -1
- package/bin/deploy/index.js +5 -2
- package/bin/eval.js +1 -1
- package/bin/extend.js +3 -3
- package/bin/login.js +2 -2
- package/bin/logout.js +1 -1
- package/bin/pull.js +1 -1
- package/bin/push.js +5 -5
- package/bin/subscribe.js +2 -2
- package/bin/unsubscribe.js +2 -2
- package/bin/upgrade.js +2 -2
- package/bin/version.js +2 -2
- package/bin/watch.js +1 -1
- package/lib/bind/bindingUtil.js +6 -3
- package/lib/bind/cfKeyProvider.js +1 -1
- package/lib/bind/userCdsrcJsonStorageProvider.js +1 -1
- package/lib/build/buildPlugin.js +6 -12
- package/lib/build/buildTaskEngine.js +24 -19
- package/lib/build/buildTaskFactory.js +27 -33
- package/lib/build/buildTaskProvider.js +1 -1
- package/lib/build/buildTaskProviderFactory.js +26 -41
- package/lib/build/constants.js +0 -1
- package/lib/build/index.js +3 -3
- package/lib/build/plugins.js +15 -15
- package/lib/build/provider/edmxBuildPlugin.js +6 -7
- package/lib/build/provider/fiori/index.js +8 -8
- package/lib/build/provider/hana/2migration.js +12 -16
- package/lib/build/provider/hana/index.js +5 -7
- package/lib/build/provider/hana/template/package.json +1 -1
- package/lib/build/provider/internalBuildPlugin.js +0 -8
- package/lib/build/provider/internalBuildTaskProvider.js +17 -21
- package/lib/build/provider/java/index.js +2 -1
- package/lib/build/provider/mtx-extension/index.js +8 -5
- package/lib/build/provider/mtx-sidecar/index.js +2 -1
- package/lib/build/provider/nodejs/index.js +64 -58
- package/lib/compile/openapi/csdl2openapi.js +29 -15
- package/lib/compile/openapi/index.js +6 -6
- package/lib/deploy/to-hana/hana.js +5 -3
- package/lib/env/schema.js +2 -3
- package/lib/index.js +68 -28
- package/lib/init/add.js +17 -0
- package/lib/init/constants.js +5 -3
- package/lib/init/index.js +39 -25
- package/lib/init/{util/merge.js → merge.js} +32 -20
- package/lib/init/{util/mvn.js → mvn.js} +5 -5
- package/lib/init/plugin.js +85 -0
- package/lib/init/projectReader.js +145 -0
- package/lib/init/registries/mta.js +151 -0
- package/lib/init/template/{kibana → application-logging}/files/mta.yaml.hbs +3 -3
- package/lib/init/template/application-logging/index.js +49 -0
- package/lib/init/template/approuter/files/mta.yaml.hbs +11 -11
- package/lib/init/template/approuter/files/xs-app.json.hbs +2 -2
- package/lib/init/template/approuter/index.js +36 -81
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +3 -3
- package/lib/init/template/cf-manifest/files/services-manifest.yml.hbs +4 -4
- package/lib/init/template/cf-manifest/index.js +4 -4
- package/lib/init/template/connectivity/index.js +22 -35
- package/lib/init/template/data/index.js +3 -2
- package/lib/init/template/destination/files/values.yaml +9 -0
- package/lib/init/template/destination/index.js +15 -47
- package/lib/init/template/enterprise-messaging/index.js +26 -58
- package/lib/init/template/enterprise-messaging-shared/index.js +23 -39
- package/lib/init/template/extensibility/index.js +16 -30
- package/lib/init/template/file-based-messaging/index.js +7 -8
- package/lib/init/template/h2/index.js +4 -4
- package/lib/init/template/hana/files/mta.yaml.hbs +8 -8
- package/lib/init/template/hana/index.js +29 -115
- package/lib/init/template/helm/files/chart/templates/NOTES.txt +12 -0
- package/lib/init/template/helm/files/chart/templates/_deployment_helpers.tpl +82 -0
- package/lib/init/template/helm/files/chart/templates/_helpers.tpl +28 -0
- package/lib/init/template/helm/files/chart/values.root.schema.json +61 -0
- package/lib/init/template/helm/files/chart/values.schema.json +366 -0
- package/lib/init/template/helm/{subcharts → files}/web-application/Chart.yaml +1 -1
- package/lib/init/template/helm/{subcharts → files}/web-application/templates/_api.tpl +1 -1
- package/lib/init/template/helm/{subcharts → files}/web-application/values.yaml +1 -1
- package/lib/init/template/helm/index.js +84 -85
- package/lib/init/template/helm-unified-runtime/files/Chart.yaml.hbs +10 -0
- package/lib/init/template/helm-unified-runtime/files/values.yaml.hbs +26 -0
- package/lib/init/template/helm-unified-runtime/index.js +91 -0
- package/lib/init/template/helm-unified-runtime/lib/build.js +0 -0
- package/lib/init/template/helm-unified-runtime/package.json +4 -0
- package/lib/init/template/html5-repo/files/values.yaml.hbs +28 -0
- package/lib/init/template/html5-repo/index.js +23 -97
- package/lib/init/template/java/index.js +3 -3
- package/lib/init/template/lint/index.js +2 -2
- package/lib/init/template/liquibase/index.js +16 -0
- package/lib/init/template/local-messaging/index.js +7 -8
- package/lib/init/template/mta/index.js +7 -19
- package/lib/init/template/mtx/index.js +2 -2
- package/lib/init/template/multitenancy/index.js +38 -89
- package/lib/init/template/nodejs/index.js +5 -4
- package/lib/init/template/notebook/index.js +1 -1
- package/lib/init/template/notifications/index.js +16 -19
- package/lib/init/template/pipeline/index.js +1 -1
- package/lib/init/template/postgres/index.js +25 -31
- package/lib/init/template/redis-messaging/index.js +23 -27
- package/lib/init/template/sample/index.js +4 -4
- package/lib/init/template/samples/index.js +2 -2
- package/lib/init/template/sqlite/files/{package.json.hbs → package.json} +0 -2
- package/lib/init/template/sqlite/index.js +6 -10
- package/lib/init/template/tiny-sample/index.js +6 -6
- package/lib/init/template/toggles/index.js +7 -8
- package/lib/init/template/typer/index.js +6 -6
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +3 -3
- package/lib/init/template/xsuaa/files/values.yaml.hbs +3 -3
- package/lib/init/template/xsuaa/index.js +27 -52
- package/lib/init/{util/template.js → template.js} +1 -1
- package/lib/{client → mtx}/activate.js +15 -11
- package/lib/{client → mtx}/auth_manager.js +5 -4
- package/lib/{client → mtx}/download_legacy.js +6 -4
- package/lib/{client → mtx}/extend.js +14 -9
- package/lib/{client → mtx}/index.js +1 -1
- package/lib/{client → mtx}/params.js +4 -1
- package/lib/{client → mtx}/pull.js +6 -4
- package/lib/{client → mtx}/push.js +11 -10
- package/lib/{client → mtx}/settings_manager.js +8 -6
- package/lib/{client → mtx}/tenant_action.js +9 -8
- package/lib/{client/helper/cf_helper.js → mtx/util/cf.js} +4 -3
- package/lib/{client/helper/dependency_helper.js → mtx/util/dependencies.js} +1 -0
- package/lib/mtx/util/errors.js +27 -0
- package/lib/mtx/util/legacy_ext.js +16 -0
- package/lib/{client/helper/url_helper.js → mtx/util/urls.js} +12 -1
- package/lib/util/fs.js +5 -1
- package/lib/util/pruneAxiosErrors.js +35 -18
- package/lib/util/write.js +1 -1
- package/npm-shrinkwrap.json +27 -27
- package/package.json +10 -1
- package/lib/client/base_command.js +0 -54
- package/lib/init/template/_merging/registry-mta.js +0 -304
- package/lib/init/template/helm/Model.d.ts +0 -53
- package/lib/init/template/kibana/files/package.json.hbs +0 -17
- package/lib/init/template/kibana/index.js +0 -54
- package/lib/init/template/templateBase.js +0 -100
- package/lib/init/util/md5.js +0 -86
- package/lib/init/util/projectReader.js +0 -94
- /package/lib/init/{util/indent.js → indent.js} +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/Chart.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/_helpers.tpl +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/job.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/secret.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/service-account.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/service-binding.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/values.schema.json +0 -0
- /package/lib/init/template/helm/{subcharts → files}/content-deployment/values.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/service-instance/Chart.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/service-instance/templates/_helpers.tpl +0 -0
- /package/lib/init/template/helm/{subcharts → files}/service-instance/templates/serviceinstance.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/service-instance/values.schema.json +0 -0
- /package/lib/init/template/helm/{subcharts → files}/service-instance/values.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/NOTES.txt +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/_helpers.tpl +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/api-rule.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/deployment.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/network-policy.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/pod-disruption-budget.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/rbac.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/secret.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service-account.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service-binding.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/templates/virtual-service.yaml +0 -0
- /package/lib/init/template/helm/{subcharts → files}/web-application/values.schema.json +0 -0
- /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/NOTES.txt +0 -0
- /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/_deployment_helpers.tpl +0 -0
- /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/_helpers.tpl +0 -0
- /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/values.root.schema.json +0 -0
- /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/values.schema.json +0 -0
- /package/lib/init/template/postgres/files/{mta.yaml.hbs → mta.yml.hbs} +0 -0
- /package/lib/init/{util/xml.js → xml.js} +0 -0
- /package/lib/{client/helper/env_helper.js → mtx/util/env.js} +0 -0
- /package/lib/{client/helper/fs_helper.js → mtx/util/fs.js} +0 -0
- /package/lib/{client/helper → mtx/util}/logging.js +0 -0
- /package/lib/{client/helper → mtx/util}/question.js +0 -0
- /package/lib/{client/helper/string_helper.js → mtx/util/strings.js} +0 -0
- /package/lib/util/{cfUtil.js → cf.js} +0 -0
- /package/lib/util/{gitUtil.js → git.js} +0 -0
|
@@ -6,13 +6,13 @@ modules:
|
|
|
6
6
|
requires:
|
|
7
7
|
- name: {{appName}}-logging
|
|
8
8
|
|
|
9
|
-
{{#
|
|
9
|
+
{{#hasMultitenancy}}
|
|
10
10
|
- name: {{appName}}-mtx
|
|
11
11
|
type: nodejs
|
|
12
12
|
path: {{#isNodejs}}gen/{{/isNodejs}}mtx/sidecar
|
|
13
13
|
requires:
|
|
14
14
|
- name: {{appName}}-logging
|
|
15
|
-
{{/
|
|
15
|
+
{{/hasMultitenancy}}
|
|
16
16
|
|
|
17
17
|
{{#hasApprouter}}
|
|
18
18
|
- name: {{appName}}
|
|
@@ -26,4 +26,4 @@ resources:
|
|
|
26
26
|
type: org.cloudfoundry.managed-service
|
|
27
27
|
parameters:
|
|
28
28
|
service: application-logs
|
|
29
|
-
service-plan:
|
|
29
|
+
service-plan: standard
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const { readProject } = require('../../projectReader')
|
|
2
|
+
const { merge } = require('../../merge')
|
|
3
|
+
const { srv4, mtxSidecar4, applicationLogging, approuter } = require('../../registries/mta')
|
|
4
|
+
|
|
5
|
+
module.exports = class ApplicationLoggingTemplate extends require('../../plugin') {
|
|
6
|
+
|
|
7
|
+
static hasInProduction(env) {
|
|
8
|
+
return !!env.features.kibana_formatter
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async canRun() {
|
|
12
|
+
const { hasMta, hasHelm, hasHelmUnifiedRuntime, isJava } = readProject()
|
|
13
|
+
if ((hasHelmUnifiedRuntime || hasHelm) && !hasMta) throw `'cds add application-logging' is not available for Kyma yet`
|
|
14
|
+
if (isJava) throw `'cds add application-logging' is not available for Java yet`
|
|
15
|
+
return true
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async combine() {
|
|
19
|
+
const project = readProject()
|
|
20
|
+
const { hasMta, hasApprouter, isJava, hasMultitenancy, srvPath } = project
|
|
21
|
+
|
|
22
|
+
if (hasMta) {
|
|
23
|
+
const srv = srv4(srvPath)
|
|
24
|
+
const additions = [srv, applicationLogging]
|
|
25
|
+
const relationships = [{
|
|
26
|
+
insert: [applicationLogging, 'name'],
|
|
27
|
+
into: [srv, 'requires', 'name']
|
|
28
|
+
}]
|
|
29
|
+
if (hasMultitenancy) {
|
|
30
|
+
const mtxSidecar = mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar')
|
|
31
|
+
additions.push(mtxSidecar)
|
|
32
|
+
relationships.push({
|
|
33
|
+
insert: [applicationLogging, 'name'],
|
|
34
|
+
into: [mtxSidecar, 'requires', 'name']
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
if (hasApprouter) {
|
|
38
|
+
additions.push(approuter)
|
|
39
|
+
relationships.push({
|
|
40
|
+
insert: [applicationLogging, 'name'],
|
|
41
|
+
into: [approuter, 'requires', 'name']
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', {
|
|
45
|
+
with: project, additions, relationships
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -4,10 +4,10 @@ modules:
|
|
|
4
4
|
type: {{language}}
|
|
5
5
|
path: {{& srvPath}}
|
|
6
6
|
{{#isJava}}
|
|
7
|
-
{{#
|
|
7
|
+
{{#hasMultitenancy}}
|
|
8
8
|
properties:
|
|
9
9
|
CDS_MULTITENANCY_APPUI_TENANTSEPARATOR: "-"
|
|
10
|
-
{{/
|
|
10
|
+
{{/hasMultitenancy}}
|
|
11
11
|
{{/isJava}}
|
|
12
12
|
requires:
|
|
13
13
|
- name: {{appName}}-auth
|
|
@@ -24,10 +24,10 @@ modules:
|
|
|
24
24
|
keep-existing-routes: true
|
|
25
25
|
disk-quota: 256M
|
|
26
26
|
memory: 256M
|
|
27
|
-
{{#
|
|
27
|
+
{{#hasMultitenancy}}
|
|
28
28
|
properties:
|
|
29
29
|
TENANT_HOST_PATTERN: "^(.*)-${default-uri}"
|
|
30
|
-
{{/
|
|
30
|
+
{{/hasMultitenancy}}
|
|
31
31
|
requires:
|
|
32
32
|
- name: srv-api
|
|
33
33
|
group: destinations
|
|
@@ -35,14 +35,14 @@ modules:
|
|
|
35
35
|
name: srv-api # must be used in xs-app.json as well
|
|
36
36
|
url: ~{srv-url}
|
|
37
37
|
forwardAuthToken: true
|
|
38
|
-
{{#
|
|
38
|
+
{{#hasMultitenancy}}
|
|
39
39
|
- name: mtx-api
|
|
40
40
|
group: destinations
|
|
41
41
|
properties:
|
|
42
42
|
name: mtx-api # must be used in xs-app.json as well
|
|
43
43
|
url: ~{mtx-url}
|
|
44
|
-
{{/
|
|
45
|
-
{{#
|
|
44
|
+
{{/hasMultitenancy}}
|
|
45
|
+
{{#hasMultitenancy}}
|
|
46
46
|
{{#isNodejs}}
|
|
47
47
|
provides:
|
|
48
48
|
- name: app-api
|
|
@@ -50,7 +50,7 @@ modules:
|
|
|
50
50
|
app-protocol: ${protocol}
|
|
51
51
|
app-uri: ${default-uri}
|
|
52
52
|
{{/isNodejs}}
|
|
53
|
-
{{/
|
|
53
|
+
{{/hasMultitenancy}}
|
|
54
54
|
{{#isJava}}
|
|
55
55
|
provides:
|
|
56
56
|
- name: app-api
|
|
@@ -58,7 +58,7 @@ modules:
|
|
|
58
58
|
url: ${default-url}
|
|
59
59
|
{{/isJava}}
|
|
60
60
|
|
|
61
|
-
{{#
|
|
61
|
+
{{#hasMultitenancy}}
|
|
62
62
|
- name: {{appName}}-mtx
|
|
63
63
|
type: nodejs
|
|
64
64
|
path: {{#isNodejs}}gen/{{/isNodejs}}mtx/sidecar
|
|
@@ -66,7 +66,7 @@ modules:
|
|
|
66
66
|
- name: app-api
|
|
67
67
|
properties:
|
|
68
68
|
SUBSCRIPTION_URL: ~{app-protocol}://\${tenant_subdomain}-~{app-uri}
|
|
69
|
-
{{/
|
|
69
|
+
{{/hasMultitenancy}}
|
|
70
70
|
|
|
71
71
|
resources:
|
|
72
72
|
- name: {{appName}}-auth
|
|
@@ -77,4 +77,4 @@ resources:
|
|
|
77
77
|
path: ./xs-security.json
|
|
78
78
|
config:
|
|
79
79
|
xsappname: {{appName}}-${org}-${space}
|
|
80
|
-
tenant-mode: {{#
|
|
80
|
+
tenant-mode: {{#hasMultitenancy}}shared{{/hasMultitenancy}}{{^hasMultitenancy}}dedicated{{/hasMultitenancy}}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"welcomeFile": "app/index.html",
|
|
3
3
|
"routes": [
|
|
4
|
-
{{#
|
|
4
|
+
{{#hasExtensibility}}
|
|
5
5
|
{
|
|
6
6
|
"source": "^/-/cds/.*",
|
|
7
7
|
"destination": "mtx-api",
|
|
8
8
|
"authenticationType": "none"
|
|
9
9
|
},
|
|
10
|
-
{{/
|
|
10
|
+
{{/hasExtensibility}}
|
|
11
11
|
{
|
|
12
12
|
"source": "^/app/(.*)$",
|
|
13
13
|
"target": "$1",
|
|
@@ -1,54 +1,49 @@
|
|
|
1
1
|
const cds = require('../../../cds')
|
|
2
|
-
const { exists } = cds.utils
|
|
2
|
+
const { exists, copy } = cds.utils
|
|
3
3
|
const { join } = require('path')
|
|
4
|
-
const { readProject } = require('../../
|
|
5
|
-
const {
|
|
6
|
-
const { XSUAA, KIBANA, HTML5_REPO } = require('../../constants').OPTIONS
|
|
4
|
+
const { readProject } = require('../../projectReader')
|
|
5
|
+
const { sort, merge } = require('../../merge')
|
|
7
6
|
const {
|
|
8
|
-
|
|
7
|
+
srv4, mtxSidecar4, approuter, // Modules
|
|
9
8
|
xsuaa, // BTP Services
|
|
10
9
|
requiredMtxApi, providedJavaApprouterApi4, providedJavaApprouterApi, // APIs
|
|
11
10
|
requiredAppApi4, providedAppApi,
|
|
12
11
|
approuterExtensibility // xs-app.json config
|
|
13
|
-
} = require('
|
|
14
|
-
const { copyAndTrack, parseMd5File, writeMd5File } = require('../../util/md5')
|
|
12
|
+
} = require('../../registries/mta')
|
|
15
13
|
|
|
16
|
-
module.exports = class ApprouterTemplate extends require('
|
|
14
|
+
module.exports = class ApprouterTemplate extends require('../../plugin') {
|
|
17
15
|
|
|
18
|
-
static
|
|
19
|
-
return exists(join(env.folders.app, 'xs-app.json'))
|
|
16
|
+
static hasInProduction(env) {
|
|
17
|
+
return exists(join(env.folders.app, 'xs-app.json')) || exists(join(env.folders.app, 'router', 'xs-app.json'))
|
|
20
18
|
}
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
return [
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
getRelatedFacets() {
|
|
27
|
-
return [KIBANA, HTML5_REPO]
|
|
20
|
+
requires() {
|
|
21
|
+
return ['xsuaa']
|
|
28
22
|
}
|
|
29
23
|
|
|
30
24
|
async run() {
|
|
31
|
-
const { appPath
|
|
25
|
+
const { appPath } = readProject()
|
|
32
26
|
const appPackageJSONPath = join(appPath, 'package.json')
|
|
33
|
-
await
|
|
27
|
+
await merge(__dirname, 'files/package.json').into(appPackageJSONPath)
|
|
34
28
|
await sort(appPackageJSONPath, 'dependencies')
|
|
35
|
-
await
|
|
29
|
+
await merge(__dirname, 'files/default-env.json').into(appPath + '/default-env.json')
|
|
36
30
|
}
|
|
37
31
|
|
|
38
|
-
async
|
|
39
|
-
const project =
|
|
40
|
-
const { isNodejs, isJava,
|
|
32
|
+
async combine() {
|
|
33
|
+
const project = readProject(this.options)
|
|
34
|
+
const { isNodejs, isJava, hasExtensibility, hasMultitenancy, hasMta, hasHelm, hasHelmUnifiedRuntime, srvPath, appPath } = project
|
|
41
35
|
|
|
42
36
|
if (hasMta) {
|
|
43
|
-
const srv = (
|
|
37
|
+
const srv = srv4(srvPath)
|
|
44
38
|
const apis = isJava ? [providedJavaApprouterApi4(srv), providedJavaApprouterApi] : []
|
|
45
39
|
const mtxSidecar = mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar')
|
|
46
|
-
if (isNodejs &&
|
|
47
|
-
if (isJava &&
|
|
40
|
+
if (isNodejs && hasMultitenancy) apis.push(requiredMtxApi, requiredAppApi4(mtxSidecar), providedAppApi)
|
|
41
|
+
if (isJava && hasMultitenancy) apis.push(requiredMtxApi)
|
|
48
42
|
const modules = [srv, approuter]
|
|
49
|
-
if (
|
|
43
|
+
if (hasMultitenancy) modules.push(mtxSidecar)
|
|
50
44
|
const additions = [...modules, xsuaa, ...apis]
|
|
51
|
-
await
|
|
45
|
+
await merge(__dirname, 'files', 'mta.yaml.hbs').into('mta.yaml', {
|
|
46
|
+
with: project,
|
|
52
47
|
additions,
|
|
53
48
|
relationships: [{
|
|
54
49
|
insert: [xsuaa, 'name'],
|
|
@@ -60,65 +55,25 @@ module.exports = class ApprouterTemplate extends require('../templateBase') {
|
|
|
60
55
|
})
|
|
61
56
|
}
|
|
62
57
|
|
|
63
|
-
if (hasHelm) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
await mergeYAML(
|
|
71
|
-
join('chart', 'values.yaml'),
|
|
72
|
-
join(__dirname, 'files', 'values.yaml.hbs'),
|
|
73
|
-
project
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
// add dependency entry in chart.yaml
|
|
77
|
-
const HelmTemplate = require(`../helm`);
|
|
78
|
-
const helmTemplate = new HelmTemplate(context.oldTrackingData, context.newTrackingData);
|
|
79
|
-
await helmTemplate.addDependency('web-application', 'approuter');
|
|
58
|
+
if (hasHelm || hasHelmUnifiedRuntime) {
|
|
59
|
+
await merge(__dirname, 'files', 'values.yaml.hbs').into('chart/values.yaml', { with: project })
|
|
60
|
+
await merge({ approuter: { envFrom: [{
|
|
61
|
+
configMapRef: {
|
|
62
|
+
name: "{{ .Release.Name }}-approuter-configmap"
|
|
63
|
+
}
|
|
64
|
+
}]}}).into('chart/values.yaml', { with: project })
|
|
80
65
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
approuter: {
|
|
85
|
-
envFrom: [
|
|
86
|
-
{
|
|
87
|
-
configMapRef: {
|
|
88
|
-
name: "{{ .Release.Name }}-approuter-configmap"
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
project
|
|
95
|
-
)
|
|
66
|
+
const fileName = hasMultitenancy ? 'approuter-mtxs-configmap.yaml' : 'approuter-configmap.yaml'
|
|
67
|
+
await copy(join(__dirname, 'files', fileName)).to('chart', 'templates', 'approuter-configmap.yaml')
|
|
96
68
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
join(__dirname, 'files', fileName),
|
|
101
|
-
join('chart', 'templates', 'approuter-configmap.yaml'),
|
|
102
|
-
context,
|
|
103
|
-
{ force: true }
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
if(isMultitenant) {
|
|
107
|
-
const mtxsConfigMapFileName = isNodejs ? 'mtxs-configmap-nodejs.yaml' : 'mtxs-configmap-java.yaml';
|
|
108
|
-
await copyAndTrack(
|
|
109
|
-
join(__dirname, 'files', mtxsConfigMapFileName),
|
|
110
|
-
join('chart', 'templates', 'mtxs-configmap.yaml'),
|
|
111
|
-
context,
|
|
112
|
-
{ force: true }
|
|
113
|
-
)
|
|
69
|
+
if (hasMultitenancy) {
|
|
70
|
+
const mtxsConfigMapFileName = isNodejs ? 'mtxs-configmap-nodejs.yaml' : 'mtxs-configmap-java.yaml'
|
|
71
|
+
await copy(join(__dirname, 'files', mtxsConfigMapFileName)).to('chart', 'templates', 'mtxs-configmap.yaml')
|
|
114
72
|
}
|
|
115
|
-
|
|
116
|
-
if (isIndependentCommand) await writeMd5File(join('chart', '.cds-add-helm-files.md5'), context.newTrackingData);
|
|
117
|
-
|
|
118
73
|
}
|
|
119
74
|
|
|
120
75
|
const xsAppPath = join(appPath, 'xs-app.json')
|
|
121
|
-
const additions =
|
|
122
|
-
await
|
|
76
|
+
const additions = hasExtensibility ? [{ ...approuterExtensibility, at: 0 }] : []
|
|
77
|
+
await merge(__dirname, 'files/xs-app.json.hbs').into(xsAppPath, { project, additions })
|
|
123
78
|
}
|
|
124
79
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Generated manifest.yml based on template version 0.1.0
|
|
2
2
|
# appName = {{appName}}
|
|
3
3
|
# language={{language}}
|
|
4
|
-
# multitenancy={{
|
|
4
|
+
# multitenancy={{hasMultitenancy}}
|
|
5
5
|
---
|
|
6
6
|
applications:
|
|
7
7
|
# -----------------------------------------------------------------------------------
|
|
@@ -31,7 +31,7 @@ applications:
|
|
|
31
31
|
{{/hasXsuaa}}
|
|
32
32
|
|
|
33
33
|
{{#hasHana}}
|
|
34
|
-
{{^
|
|
34
|
+
{{^hasMultitenancy}}
|
|
35
35
|
# -----------------------------------------------------------------------------------
|
|
36
36
|
# HANA Database Content Deployer App
|
|
37
37
|
# -----------------------------------------------------------------------------------
|
|
@@ -44,5 +44,5 @@ applications:
|
|
|
44
44
|
buildpack: nodejs_buildpack
|
|
45
45
|
services:
|
|
46
46
|
- {{appName}}-db
|
|
47
|
-
{{/
|
|
47
|
+
{{/hasMultitenancy}}
|
|
48
48
|
{{/hasHana}}
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
---
|
|
4
4
|
create-services:
|
|
5
5
|
{{#hasHana}}
|
|
6
|
-
{{#
|
|
6
|
+
{{#hasMultitenancy}}
|
|
7
7
|
- name: {{appName}}-db
|
|
8
8
|
broker: service-manager
|
|
9
9
|
plan: container
|
|
10
|
-
{{/
|
|
11
|
-
{{^
|
|
10
|
+
{{/hasMultitenancy}}
|
|
11
|
+
{{^hasMultitenancy}}
|
|
12
12
|
- name: {{appName}}-db
|
|
13
13
|
broker: hana
|
|
14
14
|
plan: hdi-shared
|
|
15
|
-
{{/
|
|
15
|
+
{{/hasMultitenancy}}
|
|
16
16
|
{{/hasHana}}
|
|
17
17
|
{{#hasXsuaa}}
|
|
18
18
|
- name: {{appName}}-auth
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const { join } = require('path')
|
|
2
2
|
const cds = require('../../../cds')
|
|
3
3
|
const { exists } = require('../../../cds').utils
|
|
4
|
-
const { readProject } = require('../../
|
|
5
|
-
const { renderAndCopy } = require('../../
|
|
4
|
+
const { readProject } = require('../../projectReader')
|
|
5
|
+
const { renderAndCopy } = require('../../template')
|
|
6
6
|
const MANIFEST_FILE = 'manifest.yml'
|
|
7
7
|
const SERVICES_MANIFEST_FILE = 'services-manifest.yml'
|
|
8
8
|
|
|
9
|
-
module.exports = class CfManifestTemplate extends require('
|
|
9
|
+
module.exports = class CfManifestTemplate extends require('../../plugin') {
|
|
10
10
|
|
|
11
11
|
async canRun() {
|
|
12
12
|
if (cds.cli.options.force) {
|
|
@@ -19,7 +19,7 @@ module.exports = class CfManifestTemplate extends require('../templateBase') {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
async run() {
|
|
22
|
-
const project =
|
|
22
|
+
const project = readProject()
|
|
23
23
|
await renderAndCopy(join(__dirname, 'files'), cds.root, project)
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,59 +1,46 @@
|
|
|
1
|
+
const cds = require('../../../cds')
|
|
2
|
+
const { copy } = cds.utils
|
|
1
3
|
const { join } = require('path')
|
|
2
|
-
const { readProject } = require('../../
|
|
3
|
-
const {
|
|
4
|
-
const {
|
|
5
|
-
const { srvJava4, srvNode4, connectivity } = require('../_merging/registry-mta')
|
|
4
|
+
const { readProject } = require('../../projectReader')
|
|
5
|
+
const { merge } = require('../../merge')
|
|
6
|
+
const { srv4, connectivity } = require('../../registries/mta')
|
|
6
7
|
|
|
7
|
-
module.exports = class ConnectivityTemplate extends require('
|
|
8
|
+
module.exports = class ConnectivityTemplate extends require('../../plugin') {
|
|
8
9
|
|
|
9
|
-
static
|
|
10
|
-
return env.requires.connectivity
|
|
10
|
+
static hasInProduction(env) {
|
|
11
|
+
return !!env.requires.connectivity
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
async run() {
|
|
14
15
|
// Disable setting cds.requires.connectivity for now.
|
|
15
|
-
// const project =
|
|
16
|
+
// const project = readProject()
|
|
16
17
|
// const { configFile } = project
|
|
17
|
-
// await
|
|
18
|
+
// await merge(__dirname, 'files', 'package.json.hbs').into(configFile, { with: project })
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
async
|
|
21
|
-
const project =
|
|
22
|
-
const {
|
|
21
|
+
async combine() {
|
|
22
|
+
const project = readProject()
|
|
23
|
+
const { srvPath, hasHelm, hasHelmUnifiedRuntime, hasMta } = project
|
|
23
24
|
|
|
24
25
|
if (hasMta) {
|
|
25
|
-
const srv = (
|
|
26
|
+
const srv = srv4(srvPath)
|
|
26
27
|
const additions = [srv, connectivity]
|
|
27
28
|
const relationships = [{
|
|
28
29
|
insert: [connectivity, 'name'],
|
|
29
30
|
into: [srv, 'requires', 'name']
|
|
30
31
|
}]
|
|
31
|
-
await
|
|
32
|
+
await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', { project, additions, relationships })
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
if (hasHelm) {
|
|
35
|
-
|
|
36
|
-
let isIndependentCommand = false
|
|
37
|
-
if(Object.keys(context).length == 0){
|
|
38
|
-
isIndependentCommand = true
|
|
39
|
-
context.oldTrackingData = context.newTrackingData = await parseMd5File(join('chart', '.cds-add-helm-files.md5'))
|
|
40
|
-
}
|
|
41
|
-
await mergeYAML(
|
|
42
|
-
join('chart', 'values.yaml'),
|
|
43
|
-
join(__dirname, 'files', 'values.yaml.hbs'),
|
|
35
|
+
if (hasHelm || hasHelmUnifiedRuntime) {
|
|
36
|
+
await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', {
|
|
44
37
|
project,
|
|
45
|
-
|
|
38
|
+
additions: [{
|
|
46
39
|
in: 'srv.additionalVolumes',
|
|
47
|
-
where:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}]}
|
|
52
|
-
)
|
|
53
|
-
const filesPath = join(__dirname, 'files')
|
|
54
|
-
const templatesPath = join('chart', 'templates')
|
|
55
|
-
await copyAndTrack(join(filesPath, 'connectivity-proxy-info.yaml'), join(templatesPath, 'connectivity-proxy-info.yaml'), context)
|
|
56
|
-
if(isIndependentCommand) await writeMd5File(join('chart', '.cds-add-helm-files.md5'), context.newTrackingData)
|
|
40
|
+
where: { name: 'connectivity-secret' }
|
|
41
|
+
}]
|
|
42
|
+
})
|
|
43
|
+
await copy(join(__dirname, 'files', 'connectivity-proxy-info.yaml')).to('chart', 'templates', 'connectivity-proxy-info.yaml') // REVISIT: Move to build
|
|
57
44
|
}
|
|
58
45
|
}
|
|
59
46
|
}
|
|
@@ -3,15 +3,16 @@ const cds = require('../../../cds')
|
|
|
3
3
|
const { exists, fs } = cds.utils
|
|
4
4
|
const { resolve, join, relative } = require('path');
|
|
5
5
|
const DEBUG = cds.debug('cli')
|
|
6
|
+
const { env4 } = require('../../projectReader')
|
|
6
7
|
|
|
7
|
-
module.exports = class DataTemplate extends require('
|
|
8
|
+
module.exports = class DataTemplate extends require('../../plugin') {
|
|
8
9
|
|
|
9
10
|
async run() {
|
|
10
11
|
if (cds.cli.options.for) {
|
|
11
12
|
throw `\nError: Did you mean \`... --data:for\` ?`
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
const env =
|
|
15
|
+
const env = env4('production')
|
|
15
16
|
|
|
16
17
|
let dest = (typeof cds.cli.options.out === 'string') // target folder
|
|
17
18
|
? cds.cli.options.out
|
|
@@ -1,71 +1,39 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const {
|
|
3
|
-
const {
|
|
4
|
-
const { srvJava4, srvNode4, destination } = require('../_merging/registry-mta')
|
|
5
|
-
const { parseMd5File, writeMd5File } = require('../../util/md5')
|
|
1
|
+
const { readProject } = require('../../projectReader')
|
|
2
|
+
const { merge } = require('../../merge')
|
|
3
|
+
const { srv4, destination } = require('../../registries/mta')
|
|
6
4
|
|
|
7
|
-
module.exports = class DestinationTemplate extends require('
|
|
5
|
+
module.exports = class DestinationTemplate extends require('../../plugin') {
|
|
8
6
|
|
|
9
|
-
static
|
|
7
|
+
static hasInProduction(env) {
|
|
10
8
|
const kinds = { odata: 1, 'odata-v2': 1, 'odata-v4': 1, rest: 1 }
|
|
11
9
|
const mtxServices = { 'cds.xt.SaasProvisioningService': 1, 'cds.xt.DeploymentService': 1, 'cds.xt.ModelProviderService': 1, 'cds.xt.ExtensibilityService': 1 }
|
|
12
10
|
const _fromMtx = service => service in mtxServices
|
|
13
11
|
const hasDestination = Object.entries(env.requires).some(([service, require]) => !_fromMtx(service) && !kinds[service] && kinds[require.kind])
|
|
14
|
-
return hasDestination || env.requires.destinations
|
|
12
|
+
return hasDestination || !!env.requires.destinations
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
async run() {
|
|
18
|
-
const project =
|
|
16
|
+
const project = readProject()
|
|
19
17
|
const { configFile } = project
|
|
20
|
-
await
|
|
18
|
+
await merge(__dirname, 'files', 'package.json.hbs').into(configFile, { with: project })
|
|
21
19
|
}
|
|
22
20
|
|
|
23
|
-
async
|
|
24
|
-
const project =
|
|
25
|
-
const {
|
|
21
|
+
async combine() {
|
|
22
|
+
const project = readProject()
|
|
23
|
+
const { hasHelm, hasHelmUnifiedRuntime, hasMta, srvPath } = project
|
|
26
24
|
|
|
27
25
|
if (hasMta) {
|
|
28
|
-
const srv = (
|
|
26
|
+
const srv = srv4(srvPath)
|
|
29
27
|
const additions = [srv, destination]
|
|
30
28
|
const relationships = [{
|
|
31
29
|
insert: [destination, 'name'],
|
|
32
30
|
into: [srv, 'requires', 'name']
|
|
33
31
|
}]
|
|
34
|
-
await
|
|
32
|
+
await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', { with: project, additions, relationships })
|
|
35
33
|
}
|
|
36
34
|
|
|
37
|
-
if (hasHelm) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
//in case facet is being added to the already exisiting charts folder
|
|
41
|
-
let isIndependentCommand = false
|
|
42
|
-
if(Object.keys(context).length == 0){
|
|
43
|
-
isIndependentCommand = true
|
|
44
|
-
context.oldTrackingData = context.newTrackingData = await parseMd5File(join('chart', '.cds-add-helm-files.md5'))
|
|
45
|
-
}
|
|
46
|
-
await mergeYAML(
|
|
47
|
-
join('chart', 'values.yaml'),
|
|
48
|
-
{
|
|
49
|
-
...binding,
|
|
50
|
-
destination: {
|
|
51
|
-
serviceOfferingName: 'destination',
|
|
52
|
-
servicePlanName: 'lite',
|
|
53
|
-
parameters: {
|
|
54
|
-
version: '1.0.0'
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
// copy service instance chart if it is not present
|
|
61
|
-
const HelmTemplate = require(`../helm`);
|
|
62
|
-
const helmTemplate = new HelmTemplate(context.oldTrackingData, context.newTrackingData);
|
|
63
|
-
isIndependentCommand = isIndependentCommand | await helmTemplate.addSubChart('service-instance');
|
|
64
|
-
|
|
65
|
-
// add dependency entry in chart.yaml
|
|
66
|
-
await helmTemplate.addDependency('service-instance', 'destination');
|
|
67
|
-
|
|
68
|
-
if(isIndependentCommand) await writeMd5File(join('chart', '.cds-add-helm-files.md5'), context.newTrackingData)
|
|
35
|
+
if (hasHelm || hasHelmUnifiedRuntime) {
|
|
36
|
+
await merge(__dirname, 'files/values.yaml').into('chart/values.yaml')
|
|
69
37
|
}
|
|
70
38
|
}
|
|
71
39
|
}
|