Skip to content

Commit 1c838da

Browse files
added cloud deyployment support (st)
1 parent 1f7950b commit 1c838da

File tree

9 files changed

+267
-2023
lines changed

9 files changed

+267
-2023
lines changed

.cdsrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"requires": {
3+
"db": "hana"
4+
}
5+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ default-env.json
1616

1717
**/node/
1818
**/node_modules/
19+
**/package-lock.json
20+
package-lock.json
1921

2022
**/.mta/
2123
*.mtar
24+
*.mta
2225

2326
*.log*
2427
gc_history*

db/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "deploy",
3+
"dependencies": {
4+
"hdb": "^0",
5+
"@sap/hdi-deploy": "^5"
6+
},
7+
"engines": {
8+
"node": "^22.0.0"
9+
},
10+
"scripts": {
11+
"start": "node node_modules/@sap/hdi-deploy/deploy.js --use-hdb --parameter com.sap.hana.di.table/try_fast_table_migration=true",
12+
"build": "npm i && npx cds build .. --for hana --production"
13+
}
14+
}

db/src/.hdiconfig

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{
2+
"file_suffixes": {
3+
"csv": {
4+
"plugin_name": "com.sap.hana.di.tabledata.source"
5+
},
6+
"hdbafllangprocedure": {
7+
"plugin_name": "com.sap.hana.di.afllangprocedure"
8+
},
9+
"hdbanalyticprivilege": {
10+
"plugin_name": "com.sap.hana.di.analyticprivilege"
11+
},
12+
"hdbcalculationview": {
13+
"plugin_name": "com.sap.hana.di.calculationview"
14+
},
15+
"hdbcollection": {
16+
"plugin_name": "com.sap.hana.di.collection"
17+
},
18+
"hdbconstraint": {
19+
"plugin_name": "com.sap.hana.di.constraint"
20+
},
21+
"hdbdropcreatetable": {
22+
"plugin_name": "com.sap.hana.di.dropcreatetable"
23+
},
24+
"hdbflowgraph": {
25+
"plugin_name": "com.sap.hana.di.flowgraph"
26+
},
27+
"hdbfunction": {
28+
"plugin_name": "com.sap.hana.di.function"
29+
},
30+
"hdbgraphworkspace": {
31+
"plugin_name": "com.sap.hana.di.graphworkspace"
32+
},
33+
"hdbhadoopmrjob": {
34+
"plugin_name": "com.sap.hana.di.virtualfunctionpackage.hadoop"
35+
},
36+
"hdbindex": {
37+
"plugin_name": "com.sap.hana.di.index"
38+
},
39+
"hdblibrary": {
40+
"plugin_name": "com.sap.hana.di.library"
41+
},
42+
"hdbmigrationtable": {
43+
"plugin_name": "com.sap.hana.di.table.migration"
44+
},
45+
"hdbprocedure": {
46+
"plugin_name": "com.sap.hana.di.procedure"
47+
},
48+
"hdbprojectionview": {
49+
"plugin_name": "com.sap.hana.di.projectionview"
50+
},
51+
"hdbprojectionviewconfig": {
52+
"plugin_name": "com.sap.hana.di.projectionview.config"
53+
},
54+
"hdbreptask": {
55+
"plugin_name": "com.sap.hana.di.reptask"
56+
},
57+
"hdbresultcache": {
58+
"plugin_name": "com.sap.hana.di.resultcache"
59+
},
60+
"hdbrole": {
61+
"plugin_name": "com.sap.hana.di.role"
62+
},
63+
"hdbroleconfig": {
64+
"plugin_name": "com.sap.hana.di.role.config"
65+
},
66+
"hdbsearchruleset": {
67+
"plugin_name": "com.sap.hana.di.searchruleset"
68+
},
69+
"hdbsequence": {
70+
"plugin_name": "com.sap.hana.di.sequence"
71+
},
72+
"hdbstatistics": {
73+
"plugin_name": "com.sap.hana.di.statistics"
74+
},
75+
"hdbstructuredprivilege": {
76+
"plugin_name": "com.sap.hana.di.structuredprivilege"
77+
},
78+
"hdbsynonym": {
79+
"plugin_name": "com.sap.hana.di.synonym"
80+
},
81+
"hdbsynonymconfig": {
82+
"plugin_name": "com.sap.hana.di.synonym.config"
83+
},
84+
"hdbsystemversioning": {
85+
"plugin_name": "com.sap.hana.di.systemversioning"
86+
},
87+
"hdbtable": {
88+
"plugin_name": "com.sap.hana.di.table"
89+
},
90+
"hdbtabledata": {
91+
"plugin_name": "com.sap.hana.di.tabledata"
92+
},
93+
"hdbtabletype": {
94+
"plugin_name": "com.sap.hana.di.tabletype"
95+
},
96+
"hdbtrigger": {
97+
"plugin_name": "com.sap.hana.di.trigger"
98+
},
99+
"hdbview": {
100+
"plugin_name": "com.sap.hana.di.view"
101+
},
102+
"hdbvirtualfunction": {
103+
"plugin_name": "com.sap.hana.di.virtualfunction"
104+
},
105+
"hdbvirtualfunctionconfig": {
106+
"plugin_name": "com.sap.hana.di.virtualfunction.config"
107+
},
108+
"hdbvirtualpackagehadoop": {
109+
"plugin_name": "com.sap.hana.di.virtualpackage.hadoop"
110+
},
111+
"hdbvirtualpackagesparksql": {
112+
"plugin_name": "com.sap.hana.di.virtualpackage.sparksql"
113+
},
114+
"hdbvirtualprocedure": {
115+
"plugin_name": "com.sap.hana.di.virtualprocedure"
116+
},
117+
"hdbvirtualprocedureconfig": {
118+
"plugin_name": "com.sap.hana.di.virtualprocedure.config"
119+
},
120+
"hdbvirtualtable": {
121+
"plugin_name": "com.sap.hana.di.virtualtable"
122+
},
123+
"hdbvirtualtableconfig": {
124+
"plugin_name": "com.sap.hana.di.virtualtable.config"
125+
},
126+
"properties": {
127+
"plugin_name": "com.sap.hana.di.tabledata.properties"
128+
},
129+
"tags": {
130+
"plugin_name": "com.sap.hana.di.tabledata.properties"
131+
},
132+
"txt": {
133+
"plugin_name": "com.sap.hana.di.copyonly"
134+
},
135+
"hdbeshconfig": {
136+
"plugin_name": "com.sap.hana.di.eshconfig"
137+
}
138+
}
139+
}

db/undeploy.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
"src/gen/**/*.hdbview",
3+
"src/gen/**/*.hdbindex",
4+
"src/gen/**/*.hdbconstraint",
5+
"src/gen/**/*_drafts.hdbtable",
6+
"src/gen/**/*.hdbcalculationview"
7+
]

mta.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
_schema-version: 3.3.0
2+
ID: xflights
3+
version: 1.0.0-SNAPSHOT
4+
description: "xflights for Java"
5+
parameters:
6+
enable-parallel-deployments: true
7+
modules:
8+
- name: xflights-srv
9+
type: java
10+
path: srv
11+
parameters:
12+
instances: 1
13+
buildpack: sap_java_buildpack_jakarta
14+
routes:
15+
- route: "${default-host}.cert.${default-domain}"
16+
properties:
17+
SPRING_PROFILES_ACTIVE: cloud
18+
JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']"
19+
JBP_CONFIG_SAP_MACHINE_JRE: '{ version: 21.+ }'
20+
build-parameters:
21+
builder: custom
22+
commands:
23+
- mvn clean package -DskipTests=true --batch-mode
24+
build-result: target/*-exec.jar
25+
provides:
26+
- name: srv-api # required by consumers of CAP services (e.g. approuter)
27+
properties:
28+
srv-url: ${default-url}
29+
srv-cert-url: '${protocol}://${default-host}.cert.${default-domain}'
30+
requires:
31+
- name: xflights-ias
32+
parameters:
33+
config:
34+
credential-type: X509_GENERATED
35+
app-identifier: srv
36+
- name: xflights-db
37+
38+
- name: xflights-db-deployer
39+
type: hdb
40+
path: db
41+
parameters:
42+
buildpack: nodejs_buildpack
43+
build-parameters:
44+
builder: custom
45+
commands:
46+
- npm run build
47+
requires:
48+
- name: xflights-db
49+
50+
resources:
51+
resources:
52+
- name: xflights-ias
53+
type: org.cloudfoundry.managed-service
54+
parameters:
55+
service: identity
56+
service-name: xflights-ias
57+
service-plan: application
58+
config:
59+
display-name: xflights
60+
- name: xflights-db
61+
type: com.sap.xs.hdi-container
62+
parameters:
63+
service: hana
64+
service-plan: hdi-shared

0 commit comments

Comments
 (0)