Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

DEVELOPMENT.md 1.9 KiB

il y a 1 mois
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Development Guide
  2. ## Docker local development setup
  3. You should have docker installed in your system, if not click [here](https://docs.docker.com/get-docker/).
  4. 1. Go to diagrams root directory.
  5. 2. Build the docker image.
  6. ```shell
  7. docker build --tag diagrams:1.0 -f ./docker/dev/Dockerfile .
  8. ```
  9. 3. Create the container, run in background and mount the project source code.
  10. ```shell
  11. docker run -d \
  12. -it \
  13. --name diagrams \
  14. --mount type=bind,source="$(pwd)",target=/usr/src/diagrams \
  15. diagrams:1.0
  16. ```
  17. 4. Run unit tests in the host using the container to confirm that it's working.
  18. ```shell
  19. docker exec diagrams python -m unittest tests/*.py -v
  20. ```
  21. 5. Run the bash script `autogen.sh` to test.
  22. ```shell
  23. docker exec diagrams ./autogen.sh
  24. ```
  25. 6. If the unit tests and the bash script `autogen.sh` is working correctly, then your system is now ready for development.
  26. ## Mac local development setup
  27. To be able to develop and run diagrams locally on you Mac device, you should have [Python](https://www.python.org/downloads/), [Go](https://golang.org/doc/install), and [brew](https://brew.sh/) installed on your system.
  28. 1. Go to diagrams root directory.
  29. 2. Install poetry, the Python project management package used by diagrams.
  30. ```shell
  31. pip install poetry
  32. ```
  33. 3. Install the project's Python dependencies.
  34. ```shell
  35. poetry install
  36. ```
  37. 4. Install diagrams binary dependencies.
  38. ```shell
  39. brew install imagemagick inkscape black
  40. go get github.com/mingrammer/round
  41. ```
  42. 5. Run unit tests to confirm that it's working.
  43. ```shell
  44. python -m unittest tests/*.py -v
  45. ```
  46. 6. Run the bash script `autogen.sh` to test.
  47. ```shell
  48. ./autogen.sh
  49. ```
  50. 7. If the unit tests and the bash script `autogen.sh` is working correctly, then your system is now ready for development.