You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DEVELOPMENT.md 1.9 KiB

1 kuukausi sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 install github.com/mingrammer/round@latest
  41. # ln -sf ~/go/bin/round ~/.local/bin/round
  42. ```
  43. 5. Run unit tests to confirm that it's working.
  44. ```shell
  45. python -m unittest tests/*.py -v
  46. ```
  47. 6. Run the bash script `autogen.sh` to test.
  48. ```shell
  49. ./autogen.sh
  50. ```
  51. 7. If the unit tests and the bash script `autogen.sh` is working correctly, then your system is now ready for development.