Skip to content
Snippets Groups Projects
Verified Commit e7913740 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Collect static files and apply migrations

parent 78762822
Branches
No related tags found
No related merge requests found
...@@ -105,3 +105,17 @@ def test_virtualenv(host): ...@@ -105,3 +105,17 @@ def test_virtualenv(host):
intersection = expected_packages & names intersection = expected_packages & names
assert intersection == expected_packages assert intersection == expected_packages
def test_static_files_copied(host):
f = host.file("/srv/funkwhale/data/static/admin/css/base.css")
assert f.exists is True
def test_migrations_applied(host):
cmd = """
sudo -u postgres psql funkwhale -A -t -c "SELECT 1 from django_migrations where app = 'music' and name = '0039_auto_20190423_0820';"
"""
result = host.run(cmd)
assert result.stdout == "1"
...@@ -74,6 +74,8 @@ ...@@ -74,6 +74,8 @@
remote_src: true remote_src: true
- name: "Setup virtualenv" - name: "Setup virtualenv"
become: true
become_user: "{{ funkwhale_username }}"
pip: pip:
name: wheel name: wheel
virtualenv: "{{ funkwhale_install_path }}/virtualenv" virtualenv: "{{ funkwhale_install_path }}/virtualenv"
...@@ -81,7 +83,25 @@ ...@@ -81,7 +83,25 @@
- name: "Install python dependencies" - name: "Install python dependencies"
become: true
become_user: "{{ funkwhale_username }}"
pip: pip:
requirements: "{{ funkwhale_install_path }}/api/requirements.txt" requirements: "{{ funkwhale_install_path }}/api/requirements.txt"
virtualenv: "{{ funkwhale_install_path }}/virtualenv" virtualenv: "{{ funkwhale_install_path }}/virtualenv"
virtualenv_python: python3 virtualenv_python: python3
- name: "Collect static files"
command: "{{ funkwhale_install_path }}/virtualenv/bin/python api/manage.py collectstatic --no-input"
become: true
become_user: "{{ funkwhale_username }}"
args:
chdir: "{{ funkwhale_install_path }}"
- name: "Apply database migrations"
become: true
become_user: "{{ funkwhale_username }}"
command: "{{ funkwhale_install_path }}/virtualenv/bin/python api/manage.py migrate --no-input"
args:
chdir: "{{ funkwhale_install_path }}"
--- ---
- include: packages.yml # - include: packages.yml
- include: db.yml # - include: db.yml
- include: redis.yml # - include: redis.yml
- include: funkwhale.yml - include: funkwhale.yml
- include: nginx.yml - include: nginx.yml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment