Commit 7c509208 authored by Florent Chehab's avatar Florent Chehab
Browse files

Merge branch 'new_file_orga' into 'master'

New repo organization

Closes #38

See merge request !42
parents 818af843 f794902c
Pipeline #34760 failed with stages
in 2 minutes and 40 seconds
...@@ -5,7 +5,6 @@ db.sqlite3 ...@@ -5,7 +5,6 @@ db.sqlite3
/static /static
.DS_Store .DS_Store
/media/* /media/*
node_modules
.coverage .coverage
htmlcov htmlcov
.vscode .vscode
......
...@@ -31,7 +31,7 @@ flake8: ...@@ -31,7 +31,7 @@ flake8:
image: python:3.6.5-jessie image: python:3.6.5-jessie
script: script:
- pip install flake8 - pip install flake8
- flake8 - cd backend && flake8
tags: tags:
- docker - docker
...@@ -43,8 +43,8 @@ pages: ...@@ -43,8 +43,8 @@ pages:
script: script:
- mkdir .public - mkdir .public
- mv htmlcov/ .public/coverage - mv htmlcov/ .public/coverage
- make docs - make documentation
- mv docs/ .public/docs - mv documentation/ .public/documentation
- mv .public public - mv .public public
artifacts: artifacts:
paths: paths:
...@@ -54,22 +54,3 @@ pages: ...@@ -54,22 +54,3 @@ pages:
- master - master
tags: tags:
- docker - docker
deliver_for_production:
type: deploy
before_script:
## look here for info : https://docs.gitlab.com/ee/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- ssh $SERVER_USER_USERNAME@$SERVER 'bash -s' < deploy.sh
only:
- production
tags:
- docker
...@@ -2,26 +2,26 @@ ...@@ -2,26 +2,26 @@
.PHONY: docs .PHONY: docs
install_backend: install_backend:
pip install -r requirements.txt --quiet cd backend && pip install -r requirements.txt --quiet
build_frontend: build_frontend:
npm run build cd frontend && npm run build
test_backend: test_backend:
pytest general/ frontend/ backend/ cd backend && pytest base_app/ frontend_app/ backend_app/
test_backend_server: test_backend_server:
pytest -n 4 general/ frontend/ backend/ --cov-report html cd backend && pytest -n 4 base_app/ frontend_app/ backend_app/ --cov-report html
check_backend: check_backend:
./manage.py check cd backend && ./manage.py check
run_backend: run_backend:
./manage.py runserver cd backend && ./manage.py runserver
docs: documentation:
cd docs && $(MAKE) all cd documentation && $(MAKE) all
docs_clean: documentation_clean:
cd docs && $(MAKE) clean cd documentation && $(MAKE) clean
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
1. Collaborations are welcomed 1. Collaborations are welcomed
1. The documentation is not up-to-date for now, don't mind asking questions if you have issues running the project. 1. The documentation is not up-to-date for now, don't mind asking questions if you have issues running the project.
**Retrouvez la documentation [ici](https://chehabfl.gitlab.utc.fr/outgoing_rex/docs/).** **Retrouvez la documentation [ici](https://rex-dri.gitlab.utc.fr/rex-dri/documentation/).**
...@@ -3,7 +3,7 @@ omit = ...@@ -3,7 +3,7 @@ omit =
*migrations* *migrations*
*/tests/* */tests/*
manage.py manage.py
general/wsgi.py base_app/wsgi.py
*/urls.py */urls.py
*/admin.py */admin.py
......
...@@ -4,7 +4,4 @@ ignore = E501 ...@@ -4,7 +4,4 @@ ignore = E501
exclude = exclude =
env/* env/*
node_modules/* node_modules/*
backend/urls.py base_app/settings/development.py
backend/admin.py
backend/permissions/__list_user_post_permission.py
general/settings/development.py
/static
\ No newline at end of file
default_app_config = 'backend.apps.BackendConfig'
from django.apps import AppConfig
class BackendConfig(AppConfig):
name = 'backend'
def ready(self):
import backend.signals.__create_user_modules_post_create # noqa: F401
import backend.signals.__squash_revision_by_user # noqa: F401
import backend.signals.__create_univ_modules_post_save # noqa: F401
default_app_config = 'backend_app.apps.BackendAppConfig'
...@@ -14,7 +14,7 @@ for model in api_config: ...@@ -14,7 +14,7 @@ for model in api_config:
if "model" in model and model['model']: if "model" in model and model['model']:
model = DotMap(model) model = DotMap(model)
if (not model.requires_testing) and (not model.ignore_in_admin): if (not model.requires_testing) and (not model.ignore_in_admin):
module = importlib.import_module("backend.models.{}".format (model.import_location)) module = importlib.import_module("backend_app.models.{}".format(model.import_location))
if model.versionned: if model.versionned:
VERSIONNED_MODELS.append(getattr(module, model.model)) VERSIONNED_MODELS.append(getattr(module, model.model))
else: else:
......
from django.apps import AppConfig
class BackendAppConfig(AppConfig):
name = 'backend_app'
def ready(self):
import backend_app.signals.__create_user_modules_post_create # noqa: F401
import backend_app.signals.__squash_revision_by_user # noqa: F401
import backend_app.signals.__create_univ_modules_post_save # noqa: F401
from backend.fields import JSONField from backend_app.fields import JSONField
from rest_framework import serializers from rest_framework import serializers
field_mapping = serializers.ModelSerializer.serializer_field_mapping field_mapping = serializers.ModelSerializer.serializer_field_mapping
......
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