bundlewrap/bundles/octoprint/items.py
Franziska Kunsmann d02538368a
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/octoprint: add systemd-wrapper script
2020-09-22 18:52:11 +02:00

38 lines
1 KiB
Python

actions = {
'octoprint_create_virtualenv': {
'command': 'sudo -u octoprint /usr/bin/python3 -m virtualenv -p python3 /opt/octoprint/venv/',
'unless': 'test -d /opt/octoprint/venv/',
'needs': {
'directory:/opt/octoprint', # provided by bundle:users
'user:octoprint',
},
},
'octoprint_install_octoprint': {
'command': 'sudo -u octoprint /opt/octoprint/venv/bin/pip install OctoPrint',
'unless': 'test -f /opt/octoprint/venv/bin/octoprint',
'needs': {
'action:octoprint_create_virtualenv',
},
},
}
svc_systemd = {
'octoprint': {
'needs': {
'file:/etc/systemd/system/octoprint.service',
'action:octoprint_install_octoprint',
},
},
}
files = {
'/etc/systemd/system/octoprint.service': {
'triggers': {
'action:systemd-reload',
'svc_systemd:octoprint:restart',
},
},
'/opt/octoprint/systemd-wrapper': {
'mode': '0755',
},
}