Commit 2d9098be authored by Florent Chehab's avatar Florent Chehab

Fixed UML generation locally

parent 1237854b
......@@ -33,8 +33,10 @@ shell_frontend:
django_shell:
docker-compose exec backend sh -c "cd backend && ./manage.py shell"
# Create or update UML diagrams for the documentation
documentation:
cd documentation && $(MAKE) all
docker-compose exec backend bash -c "cd documentation && make extract_django"
docker-compose exec gen_doc_uml bash -c "cd /usr/src/app/documentation && make convert_to_svg"
documentation_clean:
cd documentation && $(MAKE) clean
docker-compose exec backend bash -c "cd documentation && make clean"
......@@ -69,6 +69,13 @@ services:
ports:
# replicate the server port
- "5000:5000"
gen_doc_uml: # service to generate the UML of the backend
image: floawfloaw/plantuml
volumes:
- .:/usr/src/app
command: tail -F anything # keep the container alive
volumes:
# Create some local volume (should be stored in some directory on your computer)
......
all:
init:
mkdir -p generated
../manage.py graph_models backend --disable-fields -g \
| tail -n +2 > generated/architecture.dot
dot -Tsvg generated/architecture.dot -o generated/architecture.svg
extract_django: init
../backend/manage.py graph_models backend_app --disable-fields -g \
> generated/architecture.dot
../manage.py graph_models backend --disable-abstract-fields -g -I \
../backend/manage.py graph_models backend_app --disable-abstract-fields -g -I \
MyModel,MyModelVersionned,BasicModule,Scholarship,UserRestrictedModule \
| tail -n +2 > generated/abstract.dot
dot -Tsvg generated/abstract.dot -o generated/abstract.svg
> generated/abstract.dot
../manage.py graph_models backend --disable-abstract-fields -g -I \
../backend/manage.py graph_models backend_app --disable-abstract-fields -g -I \
Specialty,Offer,Semester,Department,University \
| tail -n +2 > generated/core.dot
dot -Tsvg generated/core.dot -o generated/core.svg
> generated/core.dot
../manage.py graph_models backend --disable-abstract-fields -g -I \
../backend/manage.py graph_models backend_app --disable-abstract-fields -g -I \
University,UniversityScholarship,UniversityInfo,UniversitySemestersDates,UniversityTaggedItems,UniversityDri,Campus,CampusTaggedItems \
| tail -n +2 > generated/university.dot
dot -Tsvg generated/university.dot -o generated/university.svg
> generated/university.dot
../manage.py graph_models backend --disable-abstract-fields -g -I \
../backend/manage.py graph_models backend_app --disable-abstract-fields -g -I \
Country,City,CountryTaggedItems,CityTaggedItems,CountryScholarship,CountryDri\
| tail -n +2 > generated/location.dot
dot -Tsvg generated/location.dot -o generated/location.svg
> generated/location.dot
../manage.py graph_models backend --disable-abstract-fields -g -I \
../backend/manage.py graph_models backend_app --disable-abstract-fields -g -I \
RecommendationsList,Recommendation,UserData,PreviousDeparture,PreviousDepartureFeedback,Semester,University,Sepcialty\
| tail -n +2 > generated/user.dot
> generated/user.dot
convert_to_svg: init
dot -Tsvg generated/architecture.dot -o generated/architecture.svg
dot -Tsvg generated/abstract.dot -o generated/abstract.svg
dot -Tsvg generated/core.dot -o generated/core.svg
dot -Tsvg generated/university.dot -o generated/university.svg
dot -Tsvg generated/location.dot -o generated/location.svg
dot -Tsvg generated/user.dot -o generated/user.svg
.PHONY: clean
.PHONY: clean
clean:
rm -rf generated/
......@@ -15,6 +15,7 @@ The source of the documentation is available in the `documentation` folder from
The documentation is automatically rendered locally when you run the `make up` command. It is then available on [http://localhost:5000](http://localhost:5000).
To generate or update the UML diagrams, you need to run the command (from the root of the repository): `make documentation`.
## Issues ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment