Browse Source

fix check rule infinite restart and add readma instruction

master
nicolas-arnaud 2 years ago
parent
commit
0956468721
  1. 8
      Makefile
  2. 8
      Makesudo
  3. 13
      README.md
  4. 4
      back/Dockerfile
  5. 4
      front/Dockerfile

8
Makefile

@ -9,8 +9,10 @@ prod:
dev: dev:
NODE_ENV="development" docker compose -f docker-compose.yml up --build NODE_ENV="development" docker compose -f docker-compose.yml up --build
lint: check:
NODE_ENV="beautify" docker compose -f docker-compose.yml up --build 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: debug:
NODE_ENV="debug" BUILDKIT_PROGRESS=plain docker compose -f docker-compose.yml up --build 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 docker system prune -af --volumes
re: fclean dev re: fclean dev
.PHONY: all prod dev check debug stop clean fclean re

8
Makesudo

@ -9,8 +9,10 @@ prod:
dev: dev:
sudo NODE_ENV="development" docker compose -f docker-compose.yml up --build sudo NODE_ENV="development" docker compose -f docker-compose.yml up --build
lint: check:
sudo NODE_ENV="beautify" docker compose -f docker-compose.yml up --build 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: debug:
sudo NODE_ENV="debug" BUILDKIT_PROGRESS=plain docker compose -f docker-compose.yml up --build 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 sudo docker system prune -af --volumes
re: fclean dev re: fclean dev
.PHONY: all prod dev check debug stop clean fclean re

13
README.md

@ -1,6 +1,19 @@
# Transcendence # 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: ## Dependencies:
### Front: ### Front:
- [@svelte/vite-plugin-svelte](https://www.npmjs.com/package/@sveltejs/vite-plugin-svelte) - [@svelte/vite-plugin-svelte](https://www.npmjs.com/package/@sveltejs/vite-plugin-svelte)
- [@tsconfig/svelte](https://www.npmjs.com/package/@tsconfig/svelte) - [@tsconfig/svelte](https://www.npmjs.com/package/@tsconfig/svelte)

4
back/Dockerfile

@ -9,8 +9,8 @@ ENTRYPOINT npm install; \
npm run build && npm run start:prod; \ npm run build && npm run start:prod; \
elif [[ $NODE_ENV == "debug" ]]; then \ elif [[ $NODE_ENV == "debug" ]]; then \
npm run start:debug; \ npm run start:debug; \
elif [[ $NODE_ENV == "beautify" ]]; then \ elif [[ $NODE_ENV == "check" ]]; then \
npm run format && npm run lint; \ npm run format && npm run lint; echo "=== FINISH ==="; \
elif [[ $NODE_ENV == "development" ]]; then \ elif [[ $NODE_ENV == "development" ]]; then \
npm run dev; \ npm run dev; \
else echo "NODE_ENV value isn't known."; \ else echo "NODE_ENV value isn't known."; \

4
front/Dockerfile

@ -9,6 +9,8 @@ ENTRYPOINT npm install; \
elif [[ $NODE_ENV == "development" ]]; then \ elif [[ $NODE_ENV == "development" ]]; then \
npm run dev; \ npm run dev; \
elif [[ $NODE_ENV == "debug" ]]; then \ 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."; \ else echo "Nothing to do for that NODE_ENV context."; \
fi; fi;

Loading…
Cancel
Save