bundles/pretalx: support installing plugins

This commit is contained in:
Franzi 2021-03-30 19:52:03 +02:00
parent 8503a4a946
commit da9fe36646
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -161,3 +161,29 @@ files = {
},
},
}
# run `pip install` one after another due to concurrency issues
last_action = 'action:pretalx_install'
for plugin_name, plugin_config in node.metadata.get('pretalx/plugins', {}).items():
directories[f'/opt/pretalx/plugin_{plugin_name}'] = {}
git_deploy[f'/opt/pretalx/plugin_{plugin_name}'] = {
'repo': plugin_config['repo'],
'rev': plugin_config.get('rev', 'master'),
'triggers': {
f'action:pretalx_install_plugin_{plugin_name}',
},
}
actions[f'pretalx_install_plugin_{plugin_name}'] = {
'command': f'cd /opt/pretalx/plugin_{plugin_name} && /opt/pretalx/venv/bin/pip install --upgrade .',
'needs': {
last_action,
},
'triggers': {
'svc_systemd:pretalx-web:restart',
'svc_systemd:pretalx-worker:restart',
},
'triggered': True,
}
last_action = f'action:pretalx_install_plugin_{plugin_name}'