From 1d61b270dc6df66d1fc9386283854eba2549c842 Mon Sep 17 00:00:00 2001 From: Leandro Poroli Date: Tue, 27 Aug 2024 17:10:36 -0300 Subject: [PATCH] adding the Tilt dev mode in the readme file --- .gitignore | 1 + .idea/.gitignore | 8 ------- .idea/dataSources.xml | 17 --------------- .idea/modules.xml | 8 ------- .idea/new-obd.iml | 17 --------------- .idea/vcs.xml | 6 ------ README.md | 30 ++++++++++----------------- src/cartservice/main.go | 2 -- src/frontend.dockerfile | 2 +- src/frontend/static/styles/styles.css | 3 +-- 10 files changed, 14 insertions(+), 80 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/dataSources.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/new-obd.iml delete mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index c28ee66..9dfe973 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .direnv branch-name.nix .idea +.DS_Store diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml deleted file mode 100644 index 745d0cd..0000000 --- a/.idea/dataSources.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - postgresql - true - org.postgresql.Driver - jdbc:postgresql://localhost:5432/cart - - - - - - $ProjectFileDir$ - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 02dff5e..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/new-obd.iml b/.idea/new-obd.iml deleted file mode 100644 index 0c1dfd0..0000000 --- a/.idea/new-obd.iml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index bec25a6..2223832 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,13 @@ minikube tunnel ## Development Guide -This doc explains how to build and run the OnlineBoutique source code locally using the `skaffold` command-line tool. +This doc explains how to build and run the OnlineBoutique source code locally using the `tilt` command-line tool. ### Prerequisites -- [Docker for Desktop](https://www.docker.com/products/docker-desktop). +- [Docker for Desktop](https://www.docker.com/products/docker-desktop) - kubectl (can be installed via `gcloud components install kubectl`) -- [skaffold **1.27+**](https://skaffold.dev/docs/install/) (latest version recommended), a tool that builds and deploys Docker images in bulk. +- [tilt **0.22.2+**](https://docs.tilt.dev/install.html) (latest version recommended) - [Minikube](https://minikube.sigs.k8s.io/docs/start/) (optional - see Local Cluster) ### Local Cluster @@ -78,22 +78,14 @@ This doc explains how to build and run the OnlineBoutique source code locally us 2. Run `kubectl get nodes` to verify you're connected to the respective control plane. -3. Run `skaffold run` (first time will be slow, it can take ~20 minutes). - This will build and deploy the application. If you need to rebuild the images - automatically as you refactor the code, run `skaffold dev` command. - -4. Run `kubectl get pods` to verify the Pods are ready and running. - -5. Access the web frontend through your browser - - **Minikube** requires you to run a command to access the frontend service: - - ```shell - minikube service frontend-external - ``` - - - **Docker For Desktop** should automatically provide the frontend at http://localhost:80 +3. Two options: + 1. Run `sudo tilt up`. + To deploy the app using the `./release/obd-kardinal.yaml` file, with Kardinal annotations, in the cluster. Take into account that it will use the container images defined in the YAML, it will try to pull them from the cloud. The sudo privileges are necessary in order to port-forward the port "80" + 2. Run `sudo tilt up -- --build frontend --build productcatalogservice`. + To deploy the app using the `./release/obd-kardinal.yaml` file and also create a new 'dev' flow with dev images version for the services specified with the `build` flag (valid values: 'frontend', 'cartservice', 'productcatalogservice', convine these as you want). + Edit the source code and check the changes in the dev URL, `Tilt` will trigger the hot-reload for it ## Cleanup -If you've deployed the application with `skaffold run` command, you can run -`skaffold delete` to clean up the deployed resources. +If you've deployed the application with `tilt up` command, you can run +`tilt down --delete-namespaces` to clean up the deployed resources, the `--delete-namespaces` flas is important because otherwise it won't delete the namespace. diff --git a/src/cartservice/main.go b/src/cartservice/main.go index 855dac8..0c11ad6 100644 --- a/src/cartservice/main.go +++ b/src/cartservice/main.go @@ -25,8 +25,6 @@ var ( func main() { logrus.Info("Running REST API server...") - logrus.Info("[KARDINAL-DEBUG] demo demo 3") - // This is how you set up a basic Echo router echoRouter := echo.New() echoRouter.Use(middleware.Logger()) diff --git a/src/frontend.dockerfile b/src/frontend.dockerfile index 47d643c..54d1f78 100644 --- a/src/frontend.dockerfile +++ b/src/frontend.dockerfile @@ -28,4 +28,4 @@ COPY ./frontend/templates ./templates COPY ./frontend/static ./static COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -ENTRYPOINT ["/hipstershop/frontend"] \ No newline at end of file +ENTRYPOINT ["/hipstershop/frontend"] diff --git a/src/frontend/static/styles/styles.css b/src/frontend/static/styles/styles.css index 550381d..213e763 100755 --- a/src/frontend/static/styles/styles.css +++ b/src/frontend/static/styles/styles.css @@ -185,7 +185,7 @@ header .h-control :-moz-placeholder { header .navbar.sub-navbar { height: 60px; - background-color: #bd9898; + background-color: white; font-size: 15px; color: #b4b2bb; padding-top: 0; @@ -333,7 +333,6 @@ main { .hot-product-card-name { margin-top: 8px; font-size: 18px; - color: #2c0878; } .hot-product-card-brand {