bundles/infobeamer-cms: config is toml now, deploy to src/
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
b39d87f33f
commit
6292dd4c71
7 changed files with 117 additions and 279 deletions
|
@ -1,34 +1,73 @@
|
|||
actions = {
|
||||
'infobeamer-cms_set_directory_permissions': {
|
||||
'triggered': True,
|
||||
'command': 'chown -R infobeamer-cms:infobeamer-cms /opt/infobeamer-cms/static/'
|
||||
'command': 'chown -R infobeamer-cms:infobeamer-cms /opt/infobeamer-cms/src/static/'
|
||||
},
|
||||
'infobeamer-cms_create_virtualenv': {
|
||||
'command': '/usr/bin/python3 -m virtualenv -p python3 /opt/infobeamer-cms/venv/',
|
||||
'unless': 'test -d /opt/infobeamer-cms/venv/',
|
||||
'needs': {
|
||||
# actually /opt/infobeamer-cms, but we don't create that
|
||||
'directory:/opt/infobeamer-cms/src',
|
||||
},
|
||||
},
|
||||
'infobeamer-cms_install_requirements': {
|
||||
'command': 'cd /opt/infobeamer-cms/src && /opt/infobeamer-cms/venv/bin/pip install --upgrade pip gunicorn -r requirements.txt',
|
||||
'needs': {
|
||||
'action:infobeamer-cms_create_virtualenv',
|
||||
},
|
||||
'triggered': True,
|
||||
},
|
||||
}
|
||||
|
||||
git_deploy = {
|
||||
'/opt/infobeamer-cms': {
|
||||
'/opt/infobeamer-cms/src': {
|
||||
'rev': 'master',
|
||||
'repo': 'https://github.com/sophieschi/36c3-cms.git',
|
||||
'needs': {
|
||||
'directory:/opt/infobeamer-cms',
|
||||
'directory:/opt/infobeamer-cms/src',
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:infobeamer-cms:restart',
|
||||
'action:infobeamer-cms_set_directory_permissions',
|
||||
'action:infobeamer-cms_install_requirements',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
directories = {
|
||||
'/opt/infobeamer-cms': {},
|
||||
'/opt/infobeamer-cms/src': {},
|
||||
}
|
||||
|
||||
config = node.metadata.get('infobeamer-cms/config', {})
|
||||
config['ROOMS'] = []
|
||||
|
||||
interrupts = []
|
||||
for name, data in sorted(node.metadata.get('infobeamer-cms/interrupts', {}).items()):
|
||||
interrupts.append({
|
||||
'name': name,
|
||||
'data': data,
|
||||
})
|
||||
|
||||
if interrupts:
|
||||
interrupts_dict = {
|
||||
'interrupts': interrupts,
|
||||
}
|
||||
else:
|
||||
interrupts_dict = {}
|
||||
|
||||
for room, device_id in sorted(node.metadata.get('infobeamer-cms/rooms', {}).items()):
|
||||
config['ROOMS'].append({
|
||||
'name': room,
|
||||
'device_id': device_id,
|
||||
**interrupts_dict,
|
||||
})
|
||||
|
||||
files = {
|
||||
'/opt/infobeamer-cms/settings.cfg': {
|
||||
'/opt/infobeamer-cms/settings.toml': {
|
||||
'content_type': 'mako',
|
||||
'context': node.metadata.get('infobeamer-cms/config'),
|
||||
'needs': {
|
||||
'git_deploy:/opt/infobeamer-cms',
|
||||
'context': {
|
||||
'config': config,
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:infobeamer-cms:restart',
|
||||
|
@ -36,7 +75,7 @@ files = {
|
|||
},
|
||||
'/etc/systemd/system/infobeamer-cms.service': {
|
||||
'content_type': 'mako',
|
||||
'context': node.metadata.get('infobeamer-cms/config'),
|
||||
'context': node.metadata.get('infobeamer-cms'),
|
||||
'triggers': {
|
||||
'action:systemd-reload',
|
||||
'svc_systemd:infobeamer-cms:restart',
|
||||
|
@ -49,6 +88,8 @@ files = {
|
|||
},
|
||||
},
|
||||
'/etc/systemd/system/infobeamer-cms-runperiodic.service': {
|
||||
'content_type': 'mako',
|
||||
'context': node.metadata.get('infobeamer-cms'),
|
||||
'triggers': {
|
||||
'action:systemd-reload',
|
||||
},
|
||||
|
@ -58,7 +99,7 @@ files = {
|
|||
pkg_pip = {
|
||||
'github-flask': {
|
||||
'needed_by': {
|
||||
'git_deploy:/opt/infobeamer-cms',
|
||||
'svc_systemd:infobeamer-cms',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -66,9 +107,11 @@ pkg_pip = {
|
|||
svc_systemd = {
|
||||
'infobeamer-cms': {
|
||||
'needs': {
|
||||
'file:/opt/infobeamer-cms/settings.cfg',
|
||||
'action:infobeamer-cms_install_requirements',
|
||||
'action:infobeamer-cms_set_directory_permissions',
|
||||
'file:/etc/systemd/system/infobeamer-cms.service',
|
||||
'git_deploy:/opt/infobeamer-cms',
|
||||
'file:/opt/infobeamer-cms/settings.toml',
|
||||
'git_deploy:/opt/infobeamer-cms/src',
|
||||
},
|
||||
},
|
||||
'infobeamer-cms-runperiodic.timer': {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue