diff --git a/bundles/pretalx/items.py b/bundles/pretalx/items.py index 80d636f..37a7508 100644 --- a/bundles/pretalx/items.py +++ b/bundles/pretalx/items.py @@ -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}'