From 60fcd6bde0792b6bdfb3041f7badf82193d6b2b8 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Thu, 28 Jul 2022 08:36:03 +0200 Subject: [PATCH 1/8] Add gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..723ef36f4e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file From f0e6ab1d2839a16f6799e5fa9ab78b40b49e1fb3 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Thu, 28 Jul 2022 08:36:32 +0200 Subject: [PATCH 2/8] Bump core submodule to 3.5.2 --- saleor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saleor b/saleor index d9bec4e9b8..a0335d29f9 160000 --- a/saleor +++ b/saleor @@ -1 +1 @@ -Subproject commit d9bec4e9b8898b4728176caa06764a1101761118 +Subproject commit a0335d29f9492e18275f878f1f38f9b0684228b7 From 0c20f72923cc4f5b7d47cf0b3e42f19cf6195962 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Thu, 28 Jul 2022 08:38:35 +0200 Subject: [PATCH 3/8] Bump storefront submodule to mid-jul release --- react-storefront | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-storefront b/react-storefront index f5c6992d54..7abe16fa15 160000 --- a/react-storefront +++ b/react-storefront @@ -1 +1 @@ -Subproject commit f5c6992d549f2a848248d5ab1152b324c840753b +Subproject commit 7abe16fa158dcb47552916530e2007b8e95bcda6 From fc6ae6a414eb00fe1b5c94a5bec21087256d9011 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Thu, 28 Jul 2022 08:42:41 +0200 Subject: [PATCH 4/8] Bump dashboard submodule to 3.5.0 --- saleor-dashboard | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saleor-dashboard b/saleor-dashboard index d304a5d376..1a73f3ff6e 160000 --- a/saleor-dashboard +++ b/saleor-dashboard @@ -1 +1 @@ -Subproject commit d304a5d376dc68bef80e4eeffe7a0b70f27d89e6 +Subproject commit 1a73f3ff6e113197f13e2077a3571a36658b292f From 43ac1dd314fb7bff68c8e3d9185450fa535f0ca8 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Thu, 28 Jul 2022 08:47:00 +0200 Subject: [PATCH 5/8] Remove $ prefix from shell commands examples Github has feature to copy code block. With dollar sign prefix, it can't be pasted & executed. --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 126244f8e5..7b229bee06 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ All Saleor services started from a single repository 1. Clone the repository: ``` -$ git clone https://github.com/saleor/saleor-platform.git --recursive --jobs 3 +git clone https://github.com/saleor/saleor-platform.git --recursive --jobs 3 ``` 2. We are using shared folders to enable live code reloading. Without this, Docker Compose will not start: @@ -23,33 +23,33 @@ $ git clone https://github.com/saleor/saleor-platform.git --recursive --jobs 3 3. Go to the cloned directory: ``` -$ cd saleor-platform +cd saleor-platform ``` 4. Build the application: ``` -$ docker-compose build +docker-compose build ``` 5. Apply Django migrations: ``` -$ docker-compose run --rm api python3 manage.py migrate +docker-compose run --rm api python3 manage.py migrate ``` 6. Collect static files: ``` -$ docker-compose run --rm api python3 manage.py collectstatic --noinput +docker-compose run --rm api python3 manage.py collectstatic --noinput ``` 7. Populate the database with example data and create the admin user: ``` -$ docker-compose run --rm api python3 manage.py populatedb --createsuperuser +docker-compose run --rm api python3 manage.py populatedb --createsuperuser ``` *Note that `--createsuperuser` argument creates an admin account for `admin@example.com` with the password set to `admin`.* 8. Run the application: ``` -$ docker-compose up +docker-compose up ``` *Both storefront and dashboard are quite big frontend projects and it might take up to few minutes for them to compile depending on your CPU. If nothing shows up on port 3001 or 9000 wait until `Compiled successfully` shows in the console output.* @@ -59,7 +59,7 @@ This repository contains newest stable versions. When new release appear, pull new version of this repository. In order to update all of them to their newest versions, run: ``` -$ git submodule update --remote +git submodule update --remote ``` You can find the latest version of Saleor, storefront and dashboard in their individual repositories: @@ -75,7 +75,7 @@ Most of the time both issues can be solved by cleaning up space taken by old con 1. Make sure docker stack is not running ``` -$ docker-compose stop +docker-compose stop ``` 2. Remove existing volumes @@ -108,7 +108,7 @@ If you are getting issues with lack of available space, consider prunning your d

``` -$ docker system prune +docker system prune ```

From 424bfc0b294c056fab732244983e0cc91a12652f Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Thu, 28 Jul 2022 08:56:07 +0200 Subject: [PATCH 6/8] Add makefile with common scripts --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..2ac059f770 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +bootstrap: + docker-compose build + docker-compose run --rm api python3 manage.py migrate + docker-compose run --rm api python3 manage.py collectstatic --noinput + docker-compose run --rm api python3 manage.py populatedb --createsuperuser +run: + docker-compose up +run-backend: + docker-compose up api worker +upgrade: + git submodule update --remote \ No newline at end of file From 03929cf55ccf0c8b183bfedb245703548aa2d0c2 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Thu, 28 Jul 2022 09:12:38 +0200 Subject: [PATCH 7/8] Improve documentation Add docs to Make, reorder localhost links --- README.md | 61 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 7b229bee06..fd982e81f6 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,28 @@ All Saleor services started from a single repository ## How to run it? +### With Makefile +You can run few make commands + +#### Bootstrap app +```shell +make +``` + +#### Run all services +```shell +make run +``` + +#### Run only backend services +```shell +make run-backend +``` + +See [Makefile](Makefile) for all commands + +### With Docker steps + 1. Clone the repository: ``` @@ -22,43 +44,49 @@ git clone https://github.com/saleor/saleor-platform.git --recursive --jobs 3 - Linux: No action required, sharing already enabled and memory for Docker engine is not limited. 3. Go to the cloned directory: -``` +```shell cd saleor-platform ``` 4. Build the application: -``` +```shell docker-compose build ``` 5. Apply Django migrations: -``` +```shell docker-compose run --rm api python3 manage.py migrate ``` 6. Collect static files: -``` +```shell docker-compose run --rm api python3 manage.py collectstatic --noinput ``` 7. Populate the database with example data and create the admin user: -``` +```shell docker-compose run --rm api python3 manage.py populatedb --createsuperuser ``` *Note that `--createsuperuser` argument creates an admin account for `admin@example.com` with the password set to `admin`.* 8. Run the application: -``` +```shell docker-compose up ``` *Both storefront and dashboard are quite big frontend projects and it might take up to few minutes for them to compile depending on your CPU. If nothing shows up on port 3001 or 9000 wait until `Compiled successfully` shows in the console output.* +## Where is the application running? +- Saleor Core (API) - http://localhost:8000 +- Saleor React Storefront - http://localhost:3001 +- Saleor Dashboard - http://localhost:9000 +- Jaeger UI (APM) - http://localhost:16686 +- Mailhog (Test email interface) - http://localhost:8025 ## How to update the subprojects to the newest versions? This repository contains newest stable versions. When new release appear, pull new version of this repository. In order to update all of them to their newest versions, run: -``` +```shell git submodule update --remote ``` @@ -74,19 +102,19 @@ Most of the time both issues can be solved by cleaning up space taken by old con 1. Make sure docker stack is not running -``` +```shell docker-compose stop ``` 2. Remove existing volumes **Warning!** Proceeding will remove also your database container! If you need existing data, please remove only services which cause problems! https://docs.docker.com/compose/reference/rm/ -``` +```shell docker-compose rm ``` 3. Build fresh containers -``` +```shell docker-compose build ``` @@ -107,7 +135,7 @@ If you are getting issues with lack of available space, consider prunning your d
I've been warned

-``` +```shell docker system prune ``` @@ -125,7 +153,7 @@ When testing developer releases or making local changes, you might end up in a s

I've been warned

-``` +```shell docker-compose down --volumes db ``` @@ -136,14 +164,7 @@ docker-compose down --volumes db - `docker-compose up api worker` for backend services only - `docker-compose up` for backend and frontend services - -## Where is the application running? -- Saleor Core (API) - http://localhost:8000 -- Saleor React Storefront - http://localhost:3001 -- Saleor Dashboard - http://localhost:9000 -- Jaeger UI (APM) - http://localhost:16686 -- Mailhog (Test email interface) - http://localhost:8025 - +## Feedback If you have any questions or feedback, do not hesitate to contact us via GitHub or Gitter: From 42c7b8e5a72a6145aa743b067501e989be2a7707 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Thu, 28 Jul 2022 09:34:06 +0200 Subject: [PATCH 8/8] Remove gitter from docs --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index fd982e81f6..3dae8d0fe0 100644 --- a/README.md +++ b/README.md @@ -169,8 +169,6 @@ docker-compose down --volumes db If you have any questions or feedback, do not hesitate to contact us via GitHub or Gitter: - https://github.com/saleor/saleor/discussions -- https://gitter.im/mirumee/saleor - ## License