From 074a9bf849afccb1bc6d7b42f72f4fa82fc659ec Mon Sep 17 00:00:00 2001 From: Florimond Manca Date: Fri, 18 Nov 2022 12:18:45 +0100 Subject: [PATCH] Post-facade fixes (#306) * Fix supervisor "client stopped" task * Other fixes --- Makefile | 13 ++++++++----- README.md | 24 +++++++++++++----------- ansible/roles/web/tasks/supervisor.yml | 4 ++-- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 7916b006..728e2013 100644 --- a/Makefile +++ b/Makefile @@ -54,17 +54,20 @@ start-client-legacy-tailwind: start-client-kit: ## Run SvelteKit client PORT=${client_kit_port} ${run_client_kit} "cd client/kit && npm run dev" +compose: ## Run Docker compose command (args: CMD) + ${compose} ${CMD} + compose-up: ## Start containers - ${compose} up -d + make compose CMD="up -d" compose-stop: ## Stop containers - ${compose} stop + make compose CMD=stop -compose-rm: stop-containers ## Stop and remove containers - ${compose} rm +compose-rm: compose-stop ## Stop and remove containers + make compose CMD=rm compose-ps: ## Show running containers - ${compose} ps + make compose CMD=ps build: build-api build-client ## Build API and client diff --git a/README.md b/README.md index dd4fddc1..6453b6af 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Permacoop is an open source and eco design ERP solution reserved for worker-owne You must have **[PostgreSQL](https://www.postgresql.org/)** installed, or **[Docker](https://www.docker.com/)** and **[Docker Compose](https://docs.docker.com/compose/)** to run PostgreSQL using the provided `docker-compose.yml`. -Ensure you have [Node.js](https://nodejs.org) v16 and `node-gyp` installed globally (`npm install -g node-gyp`). +Ensure you have [Node.js](https://nodejs.org) **16.x** and `node-gyp` installed globally (`npm install -g node-gyp`). ## Quickstart @@ -35,21 +35,16 @@ First, install dependencies: make install ``` -Then ensure your database is running: - -* Start the PostgreSQL Docker container using `make database-start`. You can later stop it with `make database-stop`. -* If you are using a PostgreSQL database on your host, edit `server/ormconfig.json` to fit your setup. - -You can now run database migrations: +Then start the database and other services: ``` -make database-migrate +make compose-up ``` -Finally, run an initial build: +You can now run database migrations: ``` -make build +make database-migrate ``` You can now start the application using: @@ -63,9 +58,10 @@ The server and client will be started: - API documentation available on - Client available on -To serve the built server and client locally, run `$ make build`, then: +To serve the built server and client locally, run: ``` +make build make start-dist ``` @@ -81,6 +77,12 @@ For E2E tests, you will need to install additional dependencies first: make install-client-e2e ``` +Run E2E tests using: + +``` +make test-client-e2e +``` + To run automatic code formatting, run: ``` diff --git a/ansible/roles/web/tasks/supervisor.yml b/ansible/roles/web/tasks/supervisor.yml index c03d24f7..00eb4e99 100644 --- a/ansible/roles/web/tasks/supervisor.yml +++ b/ansible/roles/web/tasks/supervisor.yml @@ -14,9 +14,9 @@ become: true notify: reload nginx -# Drop 'client' process from before client facade +# Drop 'client' process which ran before implementing sapper/sveltekit facade - name: Ensure client is stopped - supervisorctl: name=client state=absent + supervisorctl: name=client state=stopped become: true notify: reload nginx