bundles/paperless: ensure we run collectstatic and restart services
This commit is contained in:
parent
297726f297
commit
012726a2ce
1 changed files with 19 additions and 0 deletions
|
@ -52,6 +52,9 @@ actions['paperless_install'] = {
|
|||
},
|
||||
'triggers': {
|
||||
'action:paperless_migrate_database',
|
||||
*{
|
||||
f'svc_systemd:paperless-{worker}:restart' for worker in workers
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -61,6 +64,21 @@ actions['paperless_migrate_database'] = {
|
|||
'sudo -Hu paperless PAPERLESS_CONFIGURATION_PATH=/opt/paperless/paperless.conf /opt/paperless/venv/bin/python manage.py migrate',
|
||||
]),
|
||||
'triggered': True,
|
||||
'needs': {
|
||||
# /mnt/paperless is NOT created by this bundle.
|
||||
'action:paperless_install',
|
||||
'directory:/mnt/paperless',
|
||||
'file:/opt/paperless/paperless.conf',
|
||||
'user:paperless',
|
||||
'postgres_db:paperless',
|
||||
},
|
||||
}
|
||||
actions['paperless_collectstatic'] = {
|
||||
'command': ' && '.join([
|
||||
'cd /opt/paperless/src/paperless-ngx/src',
|
||||
'sudo -Hu paperless PAPERLESS_CONFIGURATION_PATH=/opt/paperless/paperless.conf /opt/paperless/venv/bin/python manage.py collectstatic',
|
||||
]),
|
||||
'triggered': True,
|
||||
'needs': {
|
||||
# /mnt/paperless is NOT created by this bundle.
|
||||
'action:paperless_install',
|
||||
|
@ -91,6 +109,7 @@ for worker in workers:
|
|||
'needs': {
|
||||
'action:paperless_install',
|
||||
'action:paperless_migrate_database',
|
||||
'action:paperless_collectstatic',
|
||||
f'file:/usr/local/lib/systemd/system/paperless-{worker}.service',
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue