Compare commits

...

2 Commits

Author SHA1 Message Date
Quentin Duchemin 00a7a5f317
[FW] Bump to 1.1.4 2021-10-17 13:37:24 +02:00
Quentin Duchemin 9ed4e33a7d
[FW] Use Compose module rather than shell for importing music
This is because for no reason, the shell module will just hang, never launching the container. This is also a bit cleaner...
2021-10-17 13:34:06 +02:00
4 changed files with 34 additions and 3 deletions

View File

@ -25,11 +25,25 @@
- name: Import music into Funkwhale - name: Import music into Funkwhale
shell: shell:
# funkwhale_import_music_directory is the mounted version of tagged
# files at previous step
cmd: "docker-compose run --rm api python manage.py import_files {{ funkwhale_import_library_id }} {{ funkwhale_import_music_directory }} --recursive --noinput --prune" cmd: "docker-compose run --rm api python manage.py import_files {{ funkwhale_import_library_id }} {{ funkwhale_import_music_directory }} --recursive --noinput --prune"
chdir: "{{ funkwhale_folder_name }}" chdir: "{{ funkwhale_folder_name }}"
- name: Run funkwhale import container
community.docker.docker_compose:
project_src: "{{ funkwhale_folder_name }}"
files: ["import.yml"]
remove_orphans: yes
pull: yes
recreate: smart
state: present
- name: Remove funkwhale import container
community.docker.docker_compose:
project_src: "{{ funkwhale_folder_name }}"
files: ["import.yml"]
state: absent
- name: Delete files once imported - name: Delete files once imported
shell: shell:
cmd: "rm -rf {{ funkwhale_import_music_directory_host }}/*" cmd: "rm -rf {{ funkwhale_import_music_directory_host }}/*"

View File

@ -41,6 +41,7 @@
mode: 0644 mode: 0644
loop: loop:
- docker-compose.yml.j2 - docker-compose.yml.j2
- import.yml.j2
- conf.env.j2 - conf.env.j2
- nginx.conf.j2 - nginx.conf.j2

View File

@ -0,0 +1,16 @@
version: "{{ compose_version }}"
services:
api:
image: "funkwhale/funkwhale:{{ funkwhale_version }}"
container_name: funkwhale_import
env_file:
- ./conf.env
volumes:
- "{{ funkwhale_import_music_directory_host }}:{{ funkwhale_import_music_directory }}:ro"
- "static:{{ funkwhale_static_root }}"
- "frontend:{{ funkwhale_frontend }}"
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
command: ["python", "manage.py", "import_files", "{{ funkwhale_import_library_id }}", "{{ funkwhale_import_music_directory }}", "--recursive", "--noinput", "--prune"]
restart: no

View File

@ -1,4 +1,4 @@
funkwhale_version: 1.1.2 funkwhale_version: 1.1.4
funkwhale_api_port: 5000 funkwhale_api_port: 5000
funkwhale_nginx_port: 80 funkwhale_nginx_port: 80
funkwhale_static_root: /static funkwhale_static_root: /static