Commit 4f5601c3 authored by Florent Chehab's avatar Florent Chehab

Merge branch 'fix_doc_uml' into 'master'

Fix doc uml

Closes #16

See merge request !49
parents 1237854b 80dc3633
Pipeline #35394 passed with stages
in 3 minutes and 45 seconds
......@@ -2,6 +2,7 @@ stages:
- check
- test
- lint
- svg-gen-docu # required to be done before documentation and in separate stages
- documentation
variables:
......@@ -22,8 +23,12 @@ check_back:
services:
- postgres:10.5
script:
- cd backend
- ./manage.py check
- cd backend && ./manage.py check
- cd ../documentation && make extract_django # Try to generate .dot files for the system architecture
artifacts:
paths:
- documentation/generated/
expire_in: 1 hour
tags:
- docker
......@@ -51,7 +56,7 @@ test_back:
artifacts:
paths:
- backend/htmlcov/
expire_in: 1 month
expire_in: 1 hour
tags:
- docker
......@@ -76,15 +81,30 @@ eslint:
tags:
- docker
generate_UML_svg:
stage: svg-gen-docu
image: floawfloaw/plantuml
script: cd documentation && make convert_to_svg
dependencies:
- check_back
artifacts:
paths:
- documentation/generated/
expire_in: 1 hour
only:
- master
tags:
- docker
pages:
stage: documentation
image: floawfloaw/plantuml
dependencies:
- test_back
- generate_UML_svg
script:
- mkdir .public
- mv backend/htmlcov/ .public/coverage
- make documentation
- mv documentation/ .public/documentation
- mv .public public
artifacts:
......
......@@ -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