Skip to content
This repository was archived by the owner on Nov 13, 2021. It is now read-only.

Commit c5828cb

Browse files
author
Marius Obert
committed
Add explainations and improve exercise questions
1 parent 865d416 commit c5828cb

File tree

6 files changed

+64
-16
lines changed

6 files changed

+64
-16
lines changed

exercises/03/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ To prepare the app for a multiple databases, change the content to:
144144
}
145145
```
146146

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.
148148
```
149149
npm install -D sqlite3
150150
```

exercises/04/readme.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ During deployment this time you should see an extra message:
4040

4141

4242
### 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. .
4444

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.
4546
```
4647
"plugin_version": "12.1.0",
4748
```
4849

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.
5053
```
5154
{
5255
"format_version": 1,

exercises/05/readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ entity Orders : cuid, managed {
125125
country : Country;
126126
}
127127
```
128-
@DJ do you think we should compress these steps into one? I'd feel fooled to you were telling me to change the same 4 lines in 3 consequitive steps.
129128

130129
Note the difference in capitalization here. The property name is `country` which is described by the type `Country`.
131130

exercises/08/readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ At this point we're confident enough to start adding custom logic, by [registeri
137137

138138

139139
### 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.
141143
```json
142144
{
143145
"name": "project-srv",

exercises/09/readme.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ Reloading the browser tab should now show the beginnings of something recognizab
8686

8787

8888
### 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:
9190
```
9291
- name: bookshop-ui
9392
type: nodejs
@@ -105,6 +104,7 @@ mta.yaml:
105104
url: ~{url}
106105
```
107106

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.
108108

109109

110110
### 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
256256

257257
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.
258258

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:
260260

261261
```cds
262262
using from '../srv/cat-service';
@@ -341,7 +341,10 @@ Books=Books
341341

342342

343343
### 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.
345348
```
346349
{
347350
"name": "bookshop-ui",
@@ -357,6 +360,8 @@ Books=Books
357360
}
358361
```
359362

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+
360365
`xs-app.json`
361366
```
362367
{
@@ -386,3 +391,7 @@ While this was a little intense as far as creation of artefacts was concerned, w
386391
1. Where might further apps be defined live in this logical structure?
387392

388393
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?
396+
397+
1. Where has this variable been used?

exercises/10/readme.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,60 @@
11
# Exercise 10
22

33

4-
#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.
513
```
614
cf apps
15+
cf services
716
```
817

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.
23+
```
1124
"deploy:cds": "cds deploy",
1225
"build:mta": "cds build/all && shx cp db/csv/Data.hdbtabledata db/src/gen/csv/ && mbt build -p=cf",
1326
"deploy:cf": "npm run build:mta && cf deploy mta_archives/${npm_package_name}_${npm_package_version}.mtar"
27+
```
1428

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.
1630

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.
1838
```
1939
npm run build:mta
2040
```
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.
2244
```
2345
cf deploy mta_archives/bookshop_1.0.0.mtar
2446
```
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

Comments
 (0)