[constellation] Run manage.py commands separately according to front mode

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
certbot_on_virtu
Yohann D'ANELLO 2021-03-24 16:55:17 +01:00
parent 01c2c508c6
commit dda90628f8
Signed by: _ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 37 additions and 4 deletions

View File

@ -5,7 +5,7 @@
update_cache: true
name:
- python3-django-crispy-forms
python3-django-filters
- python3-django-filters
- python3-djangorestframework
- python3-django-tables2
- python3-docutils
@ -48,7 +48,36 @@
ignore_errors: "{{ ansible_check_mode }}"
notify: Reload uWSGI
# In the future, migrations will be included in the repository.
- name: Make Django migrations
django_manage:
command: makemigrations
project_path: "/var/local/constellation"
notify: Reload uWSGI
- name: Migrate database
django_manage:
command: migrate
project_path: "/var/local/constellation"
notify: Reload uWSGI
- name: Load initial data
django_manage:
command: loaddata initial
project_path: "/var/local/constellation"
notify: Reload uWSGI
- name: Create static files directory
file:
path: /var/local/constellation/static
state: directory
mode: '2775'
owner: "www-data"
group: "{{ constellation.group }}"
recurse: true
- name: Collect static files
django_manage:
command: collectstatic
project_path: "/var/local/constellation"
notify: Reload uWSGI

View File

@ -62,22 +62,26 @@
group: "{{ constellation.settings_local_group }}"
- name: Compile messages
when: not constellation.front
django_manage:
command: compilemessages
project_path: "/var/local/constellation"
# In the future, migrations will be included in the repository.
- name: Make Django migrations
- name: Make Django migrations (non-front app)
when: not constellation.front
django_manage:
command: makemigrations
project_path: "/var/local/constellation"
- name: Migrate database
- name: Migrate database (non-front app)
when: not constellation.front
django_manage:
command: migrate
project_path: "/var/local/constellation"
- name: Load initial data
- name: Load initial data (non-front app)
when: not constellation.front
django_manage:
command: loaddata initial
project_path: "/var/local/constellation"