update pretalx to 2023.1.0

This commit is contained in:
Franzi 2023-09-09 17:48:22 +02:00
parent 25a484f04e
commit d9cb324bb6
Signed by: kunsi
GPG key ID: 12E3D2136B818350
10 changed files with 93 additions and 30 deletions

View file

@ -1,3 +1,6 @@
assert node.has_bundle('redis'), f'{node.name}: pretalx needs redis'
assert node.has_bundle('nodejs'), f'{node.name}: pretalx needs nodejs for rebuild and regenerate_css step'
actions = {
'pretalx_create_virtualenv': {
'command': '/usr/bin/python3 -m virtualenv -p python3 /opt/pretalx/venv/',
@ -8,17 +11,20 @@ actions = {
},
},
'pretalx_install': {
'command':
'cd /opt/pretalx/src/src && '
'/opt/pretalx/venv/bin/pip install --upgrade pip wheel gunicorn psycopg2-binary && '
'command': ' && '.join([
'cd /opt/pretalx/src',
'/opt/pretalx/venv/bin/pip install --upgrade pip wheel gunicorn psycopg2-binary',
'/opt/pretalx/venv/bin/pip install --upgrade -e .[redis]',
]),
'needs': {
'action:pretalx_create_virtualenv',
'pkg_apt:gcc',
'pkg_apt:python3-dev',
},
'triggered': True,
},
'pretalx_migrate': {
'command': 'PRETALX_CONFIG_FILE=/opt/pretalx/pretalx.cfg /opt/pretalx/venv/bin/python -m pretalx migrate',
'command': '/usr/bin/sudo -Hu pretalx PRETALX_CONFIG_FILE=/opt/pretalx/pretalx.cfg /opt/pretalx/venv/bin/python -m pretalx migrate',
'needs': {
'action:pretalx_install',
'file:/opt/pretalx/pretalx.cfg',
@ -28,24 +34,33 @@ actions = {
'triggered': True,
},
'pretalx_rebuild': {
'command': 'PRETALX_CONFIG_FILE=/opt/pretalx/pretalx.cfg /opt/pretalx/venv/bin/python -m pretalx rebuild',
'command': ' && '.join([
'cd /opt/pretalx/src/src/pretalx/frontend/schedule-editor/',
'npm install',
'PRETALX_CONFIG_FILE=/opt/pretalx/pretalx.cfg /opt/pretalx/venv/bin/python -m pretalx rebuild',
]),
'needs': {
'action:pretalx_install',
'action:pretalx_migrate',
'directory:/opt/pretalx/data',
'directory:/opt/pretalx/static',
'file:/opt/pretalx/pretalx.cfg',
'bundle:nodejs',
},
'triggers': {
# pretalx-web reads the manifest.json generated by this build-step upon startup
'svc_systemd:pretalx-web:restart',
},
'triggered': True,
},
'pretalx_regenerate-css': {
'command': 'sudo -u pretalx PRETALX_CONFIG_FILE=/opt/pretalx/pretalx.cfg /opt/pretalx/venv/bin/python -m pretalx regenerate_css',
'needs': {
'action:pretalx_install',
'action:pretalx_migrate',
'directory:/opt/pretalx/data',
'directory:/opt/pretalx/static',
'file:/opt/pretalx/pretalx.cfg',
'bundle:nodejs',
},
'triggered': True,
},
@ -70,7 +85,7 @@ directories = {
git_deploy = {
'/opt/pretalx/src': {
'repo': 'https://github.com/pretalx/pretalx.git',
'rev': node.metadata['pretalx']['version'],
'rev': node.metadata.get('pretalx/version'),
'triggers': {
'action:pretalx_install',
'action:pretalx_migrate',
@ -82,7 +97,6 @@ git_deploy = {
},
}
svc_systemd = {
'pretalx-runperiodic.timer': {
'needs': {
@ -125,15 +139,12 @@ svc_systemd = {
files = {
'/opt/pretalx/pretalx.cfg': {
'content_type': 'mako',
'context': node.metadata['pretalx'],
'context': node.metadata.get('pretalx'),
'triggers': {
'svc_systemd:pretalx-web:restart',
'svc_systemd:pretalx-worker:restart',
},
},
'/opt/pretalx/pretalx-administrators-from-group': {
'mode': '0755',
},
'/etc/systemd/system/pretalx-runperiodic.timer': {
'triggers': {
'action:systemd-reload',
@ -170,24 +181,16 @@ files = {
},
}
if node.metadata.get('pretalx/administrators-from-group-id', None):
files['/etc/cron.d/pretalx-administrators-from-group'] = {
'source': 'cron-pretalx-administrators-from-group',
'content_type': 'mako',
}
else:
files['/etc/cron.d/pretalx-administrators-from-group'] = {
'delete': True,
}
# 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():
assert '-' not in plugin_name, f'{node.name} pretalx plugin {plugin_name} must not contain dashes'
directories[f'/opt/pretalx/plugin_{plugin_name}'] = {}
git_deploy[f'/opt/pretalx/plugin_{plugin_name}'] = {
'repo': plugin_config['repo'],
'rev': plugin_config['rev'],
'rev': plugin_config.get('rev', 'master'),
'triggers': {
f'action:pretalx_install_plugin_{plugin_name}',
},

View file

@ -1,17 +1,19 @@
defaults = {
'apt': {
'packages': {
'gcc': {}, # for compiling some python deps
'gettext': {},
'python3-dev': {},
},
},
'bash_aliases': {
'pretalx': 'sudo /opt/pretalx/venv/bin/python -m pretalx',
},
'backups': {
'paths': {
'/opt/pretalx/data',
},
},
'bash_aliases': {
'pretalx': 'sudo /opt/pretalx/venv/bin/python -m pretalx',
},
'icinga2_api': {
'pretalx': {
'services': {