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 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" ``` diff --git a/documentation/meter/run-apps-locally/README.md b/documentation/meter/run-apps-locally/README.md index 7154640..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: @@ -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. @@ -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' ``` @@ -211,25 +213,24 @@ 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 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. @@ -247,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. @@ -272,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.