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
No related branches found
No related tags found
No related merge requests found
......@@ -105,3 +105,17 @@ def test_virtualenv(host):
intersection = expected_packages & names
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 @@
remote_src: true
- name: "Setup virtualenv"
become: true
become_user: "{{ funkwhale_username }}"
pip:
name: wheel
virtualenv: "{{ funkwhale_install_path }}/virtualenv"
......@@ -81,7 +83,25 @@
- name: "Install python dependencies"
become: true
become_user: "{{ funkwhale_username }}"
pip:
requirements: "{{ funkwhale_install_path }}/api/requirements.txt"
virtualenv: "{{ funkwhale_install_path }}/virtualenv"
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: db.yml
- include: redis.yml
# - include: packages.yml
# - include: db.yml
# - include: redis.yml
- include: funkwhale.yml
- include: nginx.yml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment