You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 13, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: exercises/03/readme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,7 @@ To prepare the app for a multiple databases, change the content to:
144
144
}
145
145
```
146
146
147
-
:point_right: As we want to use a local SQLite database, we need to install a client to communicate with this DH. Install the `sqlite3` package for this job.
147
+
:point_right: As we want to use a local SQLite database, we need to install a client to communicate with this DB. Install the `sqlite3` package for this job.
Copy file name to clipboardExpand all lines: exercises/04/readme.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,13 +40,16 @@ During deployment this time you should see an extra message:
40
40
41
41
42
42
### 3. Add config files for HANA
43
-
Update HANA version db/src/.hdiconfig
43
+
The `.hdiconfig` file specifies the configuration of the used HDI container. .
44
44
45
+
:point_right: Change the following property of the `db/src/.hdiconfig` file to adapt the version to the HANA version used in the SAP Cloud Platform Cloud Foundry trial.
45
46
```
46
47
"plugin_version": "12.1.0",
47
48
```
48
49
49
-
`db/csv/Data.hdbtabledata`
50
+
While SQLite automatically imports the CSV files, we need to provide more information for HANA to import those files. These import instructions are encoded in a `.hdbtabledata` file and will be read during the deployment process to the Cloud Foundry environment.
51
+
52
+
:point_right: Create a new `db/csv/Data.hdbtabledata` file with the following content to specify which data should be imported into the HANA tables.
Copy file name to clipboardExpand all lines: exercises/08/readme.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,7 +137,9 @@ At this point we're confident enough to start adding custom logic, by [registeri
137
137
138
138
139
139
### 6. Add a independent project descriptor
140
-
`svr/package.json:`
140
+
You might have noticed that there is no module descriptor for the server module defined. For the local development, such a descriptor is not needed as CDS knows how to parse those files. For the deployment to Cloud Foundry, on the other hand, such a file is required to define the module dependencies and start commands.
141
+
142
+
:point_right: Add a new `package.json` file with the following content to the `svr` module to make it cloud-ready.
Copy file name to clipboardExpand all lines: exercises/09/readme.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,8 +86,7 @@ Reloading the browser tab should now show the beginnings of something recognizab
86
86
87
87
88
88
### 3. Add a new module to the project descriptor
89
-
90
-
mta.yaml:
89
+
:point_right: Add this new module to the project descriptor file `mta.yaml` next to the other modules as follows:
91
90
```
92
91
- name: bookshop-ui
93
92
type: nodejs
@@ -105,6 +104,7 @@ mta.yaml:
105
104
url: ~{url}
106
105
```
107
106
107
+
This snippet does not only describe the runtime environment of the new module, it also injects the URL of the deployed `svr` module during deploy time.
108
108
109
109
110
110
### 4. Introduce a basic UI app to the Fiori launchpad
@@ -256,7 +256,7 @@ This is a modern UI5 component definition that points to a JSON configuration fi
256
256
257
257
This is the point where you can introduce an `index.cds` file, at the same level as the `index.html` file. This CDS index controls which services are exposed.
258
258
259
-
:point_right: Create a file `index.cds` in the `srv/`(! @DJ, please note this change) directory, and add the following single line as the initial content:
259
+
:point_right: Create a file `index.cds` in the `srv/` directory, and add the following single line as the initial content:
260
260
261
261
```cds
262
262
using from '../srv/cat-service';
@@ -341,7 +341,10 @@ Books=Books
341
341
342
342
343
343
### 10. Add the app router configuration
344
-
`package.json`
344
+
Similar to the `svr` module, Cloud Foundry needs us to add a module descriptor for here as well.
345
+
346
+
347
+
:point_right: Add a `package.json` file in the `app` module to start this module as a independent app router application within Cloud Foundry.
345
348
```
346
349
{
347
350
"name": "bookshop-ui",
@@ -357,6 +360,8 @@ Books=Books
357
360
}
358
361
```
359
362
363
+
:point_right: Add the following file to configure the app router. This file does not only define the welcome page, but also defines which request are forwarded to which Cloud Foundry application.
364
+
360
365
`xs-app.json`
361
366
```
362
367
{
@@ -386,3 +391,7 @@ While this was a little intense as far as creation of artefacts was concerned, w
386
391
1. Where might further apps be defined live in this logical structure?
387
392
388
393
1. What other features can you imagine being useful to users and supported by Fiori Elements and annotations?
394
+
395
+
1. Which variable have you accessed in the `mta.yaml` descriptor and were has it been defined?
#Check if your signed in to a Cloud Foundry organization
4
+
## 1. Sign in to Cloud Foundry
5
+
6
+
:point_right: Run the following command from your command line to log in to the referenced Cloud Foundry endpoint. When prompted use your SAP Cloud Platform credentials
7
+
```
8
+
cf login -a https://api.cf.eu10.hana.ondemand.com
9
+
```
10
+
11
+
## 2. Explore the artefacts in Cloud Foundry
12
+
:point_right: Run the following commands to see all deployed apps and provisioned backing services.
5
13
```
6
14
cf apps
15
+
cf services
7
16
```
8
17
9
-
## 1. Add npm scripts
10
-
@DJ do you think we should introduce these scripts easier (and use `npm run` commands over `cds` commands)
18
+
## 3. Add npm scripts
19
+
So far, the `package.json` file in your project root only defines scripts to test the project locally.
20
+
21
+
22
+
:point_right: Add the following script to control to build and deploy steps as well.
"deploy:cf": "npm run build:mta && cf deploy mta_archives/${npm_package_name}_${npm_package_version}.mtar"
27
+
```
14
28
15
-
npx i shx
29
+
You might have noticed, that the `shx` command isn't a typical shell command. This is actually a command from another node module.
16
30
17
-
## 2. Build the app
31
+
:point_right: Install this module in your project via the command line to allow its usage in the npm scripts.
32
+
```
33
+
npx install shx
34
+
```
35
+
36
+
## 4. Build the app
37
+
:point_right: Trigger the build process with the following command.
18
38
```
19
39
npm run build:mta
20
40
```
21
-
## 3. Deploy the archive
41
+
## 5. Deploy the archive
42
+
43
+
:point_right: One command is all it takes to deploy your project to the cloud. Execute the following command to trigger the deployment process.
22
44
```
23
45
cf deploy mta_archives/bookshop_1.0.0.mtar
24
46
```
25
-
Note: `npm run deploy:cf` would do the same
47
+
48
+
> Note: You can also use `npm run deploy:cf` to trigger both, the build and deploy steps
49
+
50
+
## Summary
51
+
52
+
You have learned the basic commands to interact with the Cloud Foundry Command Line Interface to check the state of the deployed applications. You also added the necessary scripts to your project to automate the build and deploy steps via the command line.
53
+
54
+
## Questions
55
+
56
+
1. Can you guess what the script `deploy:cf` does? Is there anything special to this script (compared to the other scripts)?
57
+
58
+
1. When you run the commands from step 2 again, what do you see now?
59
+
60
+
1. Check the SAP Cloud Platform Cockpit to see the same information. Are all apps in the `running` state now?
0 commit comments