From 0956468721377a402880ff02001bd37cbbb2b278 Mon Sep 17 00:00:00 2001 From: nicolas-arnaud Date: Thu, 23 Feb 2023 10:32:03 +0100 Subject: [PATCH] fix check rule infinite restart and add readma instruction --- Makefile | 8 ++++++-- Makesudo | 8 ++++++-- README.md | 13 +++++++++++++ back/Dockerfile | 4 ++-- front/Dockerfile | 4 +++- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ba48cc3..3b7cec1 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,10 @@ prod: dev: NODE_ENV="development" docker compose -f docker-compose.yml up --build -lint: - NODE_ENV="beautify" docker compose -f docker-compose.yml up --build +check: + NODE_ENV="check" docker compose -f docker-compose.yml run back --build + NODE_ENV="check" docker compose -f docker-compose.yml run front --build + docker compose -f docker-compose.yml down debug: NODE_ENV="debug" BUILDKIT_PROGRESS=plain docker compose -f docker-compose.yml up --build @@ -26,3 +28,5 @@ fclean: stop docker system prune -af --volumes re: fclean dev + +.PHONY: all prod dev check debug stop clean fclean re diff --git a/Makesudo b/Makesudo index 183392a..bb6048b 100644 --- a/Makesudo +++ b/Makesudo @@ -9,8 +9,10 @@ prod: dev: sudo NODE_ENV="development" docker compose -f docker-compose.yml up --build -lint: - sudo NODE_ENV="beautify" docker compose -f docker-compose.yml up --build +check: + sudo NODE_ENV="check" docker compose -f docker-compose.yml run back --build + sudo NODE_ENV="check" docker compose -f docker-compose.yml run front --build + sudo docker compose -f docker-compose.yml down debug: sudo NODE_ENV="debug" BUILDKIT_PROGRESS=plain docker compose -f docker-compose.yml up --build @@ -26,3 +28,5 @@ fclean: stop sudo docker system prune -af --volumes re: fclean dev + +.PHONY: all prod dev check debug stop clean fclean re diff --git a/README.md b/README.md index 9c95097..7e976bd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,19 @@ # Transcendence +[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)[![js-standard-style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](http://standardjs.com) + + +## Instructions: + +If you not use rootless docker, either rename Makesudo as Makefile or call `make` with `-f Makesudo`. +### Rules: +- prod: build and lauch client and server on builded resources. +- dev: launch client and server without build using nest and vite. +- check: format and lint back and check front. +- debug: launch back with debug flags. + ## Dependencies: + ### Front: - [@svelte/vite-plugin-svelte](https://www.npmjs.com/package/@sveltejs/vite-plugin-svelte) - [@tsconfig/svelte](https://www.npmjs.com/package/@tsconfig/svelte) diff --git a/back/Dockerfile b/back/Dockerfile index 8ad6bd2..451c8a4 100644 --- a/back/Dockerfile +++ b/back/Dockerfile @@ -9,8 +9,8 @@ ENTRYPOINT npm install; \ npm run build && npm run start:prod; \ elif [[ $NODE_ENV == "debug" ]]; then \ npm run start:debug; \ - elif [[ $NODE_ENV == "beautify" ]]; then \ - npm run format && npm run lint; \ + elif [[ $NODE_ENV == "check" ]]; then \ + npm run format && npm run lint; echo "=== FINISH ==="; \ elif [[ $NODE_ENV == "development" ]]; then \ npm run dev; \ else echo "NODE_ENV value isn't known."; \ diff --git a/front/Dockerfile b/front/Dockerfile index 70ef400..1d6363b 100644 --- a/front/Dockerfile +++ b/front/Dockerfile @@ -9,6 +9,8 @@ ENTRYPOINT npm install; \ elif [[ $NODE_ENV == "development" ]]; then \ npm run dev; \ elif [[ $NODE_ENV == "debug" ]]; then \ - npm run check && npm run dev; \ + npm run dev; \ + elif [[ $NODE_ENV == "check" ]]; then \ + npm run check; echo "=== FINISH ==="\ else echo "Nothing to do for that NODE_ENV context."; \ fi;