bundlewrap/bundles/ldap-frontend/items.py

73 lines
1.9 KiB
Python
Raw Normal View History

2021-12-21 09:48:22 +00:00
directories = {
'/opt/ldap-frontend/src': {},
}
git_deploy = {
'/opt/ldap-frontend/src': {
'repo': 'https://git.franzi.business/qzwi/ldap-frontend.git',
'rev': 'main',
'triggers': {
'action:ldap-frontend_install_deps',
'action:ldap-frontend_compile_translations',
2021-12-21 09:48:22 +00:00
'svc_systemd:ldap-frontend:restart',
},
},
}
actions = {
'ldap-frontend_make_virtualenv': {
'command': 'virtualenv -p python3 /opt/ldap-frontend/venv',
'unless': 'test -d /opt/ldap-frontend/venv',
'needs': {
'directory:/opt/ldap-frontend/src',
},
},
'ldap-frontend_install_deps': {
'triggered': True,
'command': ' && '.join([
'cd /opt/ldap-frontend/src',
'/opt/ldap-frontend/venv/bin/pip install --upgrade -r requirements.txt',
]),
'needs': {
'action:ldap-frontend_make_virtualenv',
},
},
'ldap-frontend_compile_translations': {
'triggered': True,
'command': ' && '.join([
'cd /opt/ldap-frontend/src/ldap_frontend',
'/opt/ldap-frontend/venv/bin/pybabel compile -d translations',
]),
'needs': {
'action:ldap-frontend_install_deps',
},
},
2021-12-21 09:48:22 +00:00
}
files = {
'/etc/systemd/system/ldap-frontend.service': {
'content_type': 'mako',
2021-12-21 09:48:22 +00:00
'triggers': {
'action:systemd-reload',
'svc_systemd:ldap-frontend:restart',
},
},
'/opt/ldap-frontend/config.json': {
'content_type': 'mako',
'triggers': {
'svc_systemd:ldap-frontend:restart',
},
},
}
svc_systemd = {
'ldap-frontend': {
'needs': {
'action:ldap-frontend_install_deps',
'action:ldap-frontend_compile_translations',
2021-12-21 09:48:22 +00:00
'file:/etc/systemd/system/ldap-frontend.service',
'file:/opt/ldap-frontend/config.json',
},
},
}