From c206463054ff732d46201a45564c3bdc8e1abbe2 Mon Sep 17 00:00:00 2001 From: D056267 Date: Wed, 6 Dec 2023 16:52:18 +0100 Subject: [PATCH 1/5] text optimization --- documentation/meter/run-apps-locally/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/meter/run-apps-locally/README.md b/documentation/meter/run-apps-locally/README.md index 7154640..b2ea57e 100644 --- a/documentation/meter/run-apps-locally/README.md +++ b/documentation/meter/run-apps-locally/README.md @@ -85,13 +85,13 @@ Using Spring Boot you can configure properties using application.properties file ## Start the Database Service, the Easy Franchise Service, and the Business Partner Service ### Prerequisites -- You have prepared the SAP HANA Cloud properties for a JDBC connection. -- You have a SAP S/4HANA Cloud system or a Business Partner mock server up and running +- You have prepared the SAP HANA Cloud [properties](https://github.com/SAP-samples/btp-kyma-multitenant-extension/blob/main/documentation/prepare/configure-hana/README.md#how-to-find-jdbc-connection-properties) (name, endpoints, ...) for a JDBC connection. +- You have a [SAP S/4HANA Cloud system or a Business Partner mock server](https://github.com/SAP-samples/btp-kyma-multitenant-extension/blob/main/documentation/prepare/configure-s4/README.md) up and running. ### Configure the hiddenconfig.properties File To run locally the services listed above, you have to configure some properties in the `hiddenconfig.properties` file: -1. Open the prepared sources from the previous steps or download the one from the GitHub [Repository](../../../code/easyfranchise/source/backend). In the **endresult** branch, you will find the source in the [code/easyfranchise/source/backend](../../../code/easyfranchise/source/backend) folder. +1. Open the prepared sources from the previous steps. As alternative you can download it from the **endresult** branch. 2. Copy the file [code/easyfranchise/source/backend/shared-code/src/main/resources/hiddenconfig-template.properties](../../../code/easyfranchise/source/backend/shared-code/src/main/resources/hiddenconfig-template.properties) to `hiddenconfig.properties` in the same folder. From f06dab4c8c95bd190ac1075d27ac8af24b042710 Mon Sep 17 00:00:00 2001 From: D056267 Date: Wed, 6 Dec 2023 18:47:43 +0100 Subject: [PATCH 2/5] text optimization --- documentation/meter/run-apps-locally/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/documentation/meter/run-apps-locally/README.md b/documentation/meter/run-apps-locally/README.md index b2ea57e..6e47568 100644 --- a/documentation/meter/run-apps-locally/README.md +++ b/documentation/meter/run-apps-locally/README.md @@ -188,14 +188,16 @@ Run the following commands to start the services. Start each in a separate comma ### Test the APIs -1. Check that you can get all mentors: +1. Onboard the first tenant by following these [instructions](https://github.com/SAP-samples/btp-kyma-multitenant-extension/blob/main/documentation/prepare/test-app-locally/README.md#onboard-the-first-tenant). + +2. Check that you can get all mentors. You should get an empty array if you haven't open the app UI till now. ``` curl --request GET 'http://localhost:8080/easyfranchise/rest/efservice/v1/mentor' ``` > Note: If the request fails, check the logs of ```ef-service``` and ```db-service```. -2. Check that you can read franchisees. +3. Check that you can read franchisees. ``` curl --request GET 'http://localhost:8080/easyfranchise/rest/efservice/v1/franchisee' ``` @@ -225,11 +227,10 @@ Run the following commands to start the services. Start each in a separate comma ```shell $ npm run serve ``` - As result the application should show where it's running. - By default this is at: + As result you get the url of the application. The port may be different if you started the mock server for example. ``` - http://localhost:8081/ + http://localhost:8082 ``` 5. Open this URL in a browser. 6. Opening the Easy Franchise UI will create a login metering info, which you should be able to see in the Day2 UI in the next step. From 78ccc5177525349ce1ff41ad31581eddcdc43c44 Mon Sep 17 00:00:00 2001 From: D056267 Date: Wed, 6 Dec 2023 19:24:12 +0100 Subject: [PATCH 3/5] updating port info --- .../meter/run-apps-locally/README.md | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/documentation/meter/run-apps-locally/README.md b/documentation/meter/run-apps-locally/README.md index 6e47568..a632c86 100644 --- a/documentation/meter/run-apps-locally/README.md +++ b/documentation/meter/run-apps-locally/README.md @@ -34,18 +34,18 @@ Using Spring Boot you can configure properties using application.properties file 2. To run the application you have the choice between using spring-boot-plugin or an executive JAR file. 3. Use the following command if you go for the spring-boot plugin: ``` - $ ./mvnw spring-boot:run -Dspring.config.location="application.properties" + ./mvnw spring-boot:run -Dspring.config.location="application.properties" ``` In case of debugging use: ``` - $ ./mvnw spring-boot:run -Dspring-boot.run.jvmArguments="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888" -Dspring.config.location="application.properties" + ./mvnw spring-boot:run -Dspring-boot.run.jvmArguments="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888" -Dspring.config.location="application.properties" ``` 4. Use the following command if you go for the executive JAR file: ``` - $ ./mvnw clean package - $ java -jar target/day2-service-0.0.1-SNAPSHOT.jar -Dspring.config.location="application.properties" + ./mvnw clean package + java -jar target/day2-service-0.0.1-SNAPSHOT.jar -Dspring.config.location="application.properties" ``` 5. Check in the browser that the server is up and running by opening [http://localhost:8091/](http://localhost:8091/). You should get something like this: @@ -213,19 +213,19 @@ Run the following commands to start the services. Start each in a separate comma 2. Open a new terminal and change directory to **ui**. ```shell - $ cd ui + cd ui ``` 3. Install Node.js modules in your repository by running: ```shell - $ npm install + npm install ``` 4. Run the server: ```shell - $ npm run serve + npm run serve ``` As result you get the url of the application. The port may be different if you started the mock server for example. @@ -248,19 +248,17 @@ Run the following commands to start the services. Start each in a separate comma 3. Install the Node.js modules. ```shell - $ npm install + npm install ``` 4. Start the service. ```shell - $ npm run serve + npm run serve ``` - As result the application should show where it's running. - By default this is at: - + As result you get the url of the application. The port may be different if you started the mock server for example. ``` - http://localhost:8081 + http://localhost:8083 ``` 5. Open this URL in a browser. @@ -273,9 +271,9 @@ Run the following commands to start the services. Start each in a separate comma - (Optional) Running a REST call against the Day2 service via CURL command and fake a user login of, for example, "Jon Smith" for "second-local-tenant-id": ```shell - curl --request PUT 'http://localhost:3000/user/login' \ + curl --request PUT 'http://localhost:8091/user/login' \ --header 'Content-Type: application/json' \ - --data-raw '{"tenantid": "second-local-tenant-id", "user": "Jon Smith"} + --data-raw '{"tenantid": "second-local-tenant-id", "user": "Jon Smith"}' ``` > Note: check our [troubleshooting page](./../../troubleshooting/no-active-user-metering-values/README.md) if you can't see any active user metering values. From 78dcfc21fe04fe2cb662cb945029eacc8f0bd4ab Mon Sep 17 00:00:00 2001 From: D056267 Date: Fri, 8 Dec 2023 09:55:27 +0100 Subject: [PATCH 4/5] adding new versions of node --- .../deployment/docker/Dockerfile-day2-approuter | 3 +-- code/day2-operations/deployment/docker/Dockerfile-day2-ui | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/code/day2-operations/deployment/docker/Dockerfile-day2-approuter b/code/day2-operations/deployment/docker/Dockerfile-day2-approuter index c33ca3f..f1591d4 100644 --- a/code/day2-operations/deployment/docker/Dockerfile-day2-approuter +++ b/code/day2-operations/deployment/docker/Dockerfile-day2-approuter @@ -1,5 +1,4 @@ -FROM node:14 - +FROM --platform=linux/amd64 node:20 WORKDIR /app COPY code/day2-operations/source/day2-approuter/package.json . diff --git a/code/day2-operations/deployment/docker/Dockerfile-day2-ui b/code/day2-operations/deployment/docker/Dockerfile-day2-ui index 215caf9..f4b8631 100644 --- a/code/day2-operations/deployment/docker/Dockerfile-day2-ui +++ b/code/day2-operations/deployment/docker/Dockerfile-day2-ui @@ -1,5 +1,5 @@ # build stage -FROM node:14-alpine as build-stage +FROM --platform=linux/amd64 node:18-alpine as build-stage WORKDIR /app COPY code/day2-operations/source/day2-ui/package*.json ./ RUN npm install From ccb098b0ae3db7d05503133728093db73d8bd8d8 Mon Sep 17 00:00:00 2001 From: D056267 Date: Fri, 8 Dec 2023 09:55:54 +0100 Subject: [PATCH 5/5] typo and text optimization --- documentation/meter/deploy/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/documentation/meter/deploy/README.md b/documentation/meter/deploy/README.md index 4f21b1d..62de46c 100644 --- a/documentation/meter/deploy/README.md +++ b/documentation/meter/deploy/README.md @@ -1,6 +1,6 @@ # Deploy the Day2 Application to Kyma -The following chapters will guide you through the deployment process of the Day2 Application. There are two options to deploy the application: manually and using a [script](../../../code/setup/day2-operations-deployment.sh). In the follwoing chapter we will describe the manual approach. For the update of the Easy Franchise application, we will only use the build script and will not explain the manual steps. If you want to understand more about the Easy Franchise deployment, check the [Deployment chapter of the Easy Franchise: Develop a Multitenant Extension Application in SAP BTP, Kyma Runtime](https://github.com/SAP-samples/btp-kyma-multitenant-extension/tree/main/documentation/deploy) mission. +The following chapters will guide you through the deployment process of the Day2 application. There are two options to deploy the application: manually and using a [script](../../../code/setup/day2-operations-deployment.sh). In the following chapter, we will describe the manual approach. For the update of the Easy Franchise application, we will only use the build script and will not explain the manual steps. If you want to understand more about the Easy Franchise deployment, check the [Deployment chapter of the Easy Franchise: Develop a Multitenant Extension Application in SAP BTP, Kyma Runtime](https://github.com/SAP-samples/btp-kyma-multitenant-extension/tree/main/documentation/deploy) mission. ## Prerequisites @@ -40,7 +40,9 @@ To execute all the necessary steps for the deployment, you will need the followi ./easyfranchise-deployment.sh ``` - You need to update the Database service, the Easy Franchise service and the UI. Alternatively, you can choose the Full-Deployment option which will conduct a complete deployment of all components. + > Note: Make sure that the file is executable. If this is not the case, you can do it for example with ```chmod 777 easyfranchise-deployment.sh``` on Unic OS and then execute the script. + + > Note: You need to update the Database service, the Easy Franchise service and the UI. Alternatively, you can choose the Full-Deployment option which will conduct a complete deployment of all components. If you have problems in providing the necessary information for the script, have a look at the [deployment script description](https://github.com/SAP-samples/btp-kyma-multitenant-extension/tree/main/documentation/appendix/script-deployment). ## Deploy the Day2 Application @@ -95,7 +97,7 @@ When we speak about **docker-repository**, we mean the combination of account an 1. Navigate to the Day2 service source folder. As the Day2 service is based on Spring, we also use Spring tools to build the image. ``` bash - cd /code/day2-operations/source/day2-service + cd code/day2-operations/source/day2-service ./mvnw spring-boot:build-image -DskipTests=true -Dspring-boot.build-image.imageName=":day2-service-0.1" ```