bundles/mjpg-streamer: introduce
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
176a41e2f3
commit
91c4846129
3 changed files with 85 additions and 0 deletions
14
bundles/mjpg-streamer/files/mjpg-streamer.service
Normal file
14
bundles/mjpg-streamer/files/mjpg-streamer.service
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
[Unit]
|
||||||
|
Description=mjpg-streamer-experimental
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=mjpg-streamer
|
||||||
|
Group=mjpg-streamer
|
||||||
|
Environment=LD_LIBRARY_PATH=/opt/mjpg-streamer/git/mjpg-streamer-experimental
|
||||||
|
ExecStart=/opt/mjpg-streamer/git/mjpg-streamer-experimental/mjpg_streamer -i "${node.metadata['mjpg-streamer']['input-plugin']}" -o "output_http.so -p 22040"
|
||||||
|
WorkingDirectory=/opt/mjpg-streamer
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
56
bundles/mjpg-streamer/items.py
Normal file
56
bundles/mjpg-streamer/items.py
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
directories = {
|
||||||
|
'/opt/mjpg-streamer/git': {
|
||||||
|
'owner': 'mjpg-streamer',
|
||||||
|
'group': 'mjpg-streamer',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
git_deploy = {
|
||||||
|
'/opt/mjpg-streamer/git': {
|
||||||
|
'repo': 'https://github.com/jacksonliam/mjpg-streamer.git',
|
||||||
|
'rev': 'master',
|
||||||
|
'triggers': {
|
||||||
|
'action:mjpg-streamer_chown',
|
||||||
|
'action:mjpg-streamer_build',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
actions = {
|
||||||
|
'mjpg-streamer_chown': {
|
||||||
|
'triggered': True,
|
||||||
|
'command': 'chown -R mjpg-streamer:mjpg-streamer /opt/mjpg-streamer/git',
|
||||||
|
'needs': {
|
||||||
|
'user:mjpg-streamer',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'mjpg-streamer_build': {
|
||||||
|
'triggered': True,
|
||||||
|
'command': 'sudo -u mjpg-streamer bash -c "cd /opt/mjpg-streamer/git/mjpg-streamer-experimental && make clean && make"',
|
||||||
|
'needs': {
|
||||||
|
'pkg_apt:',
|
||||||
|
'action:mjpg-streamer_chown',
|
||||||
|
},
|
||||||
|
'triggers': {
|
||||||
|
'svc_systemd:mjpg-streamer:restart',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
files = {
|
||||||
|
'/etc/systemd/system/mjpg-streamer.service': {
|
||||||
|
'content_type': 'mako',
|
||||||
|
'triggers': {
|
||||||
|
'svc_systemd:mjpg-streamer:restart',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_systemd = {
|
||||||
|
'mjpg-streamer': {
|
||||||
|
'needs': {
|
||||||
|
'action:mjpg-streamer_build',
|
||||||
|
'file:/etc/systemd/system/mjpg-streamer.service',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
15
bundles/mjpg-streamer/metadata.py
Normal file
15
bundles/mjpg-streamer/metadata.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
defaults = {
|
||||||
|
'apt': {
|
||||||
|
'packages': {
|
||||||
|
'cmake': {},
|
||||||
|
'libjpeg-dev': {},
|
||||||
|
'gcc': {},
|
||||||
|
'g++': {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'users': {
|
||||||
|
'mjpg-streamer': {
|
||||||
|
'home': '/opt/mjpg-streamer',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in a new issue