bundles/mautrix-whatsapp: introduce
This commit is contained in:
parent
4a3cee1623
commit
fede30c2cc
7 changed files with 277 additions and 4 deletions
70
bundles/mautrix-whatsapp/items.py
Normal file
70
bundles/mautrix-whatsapp/items.py
Normal file
|
@ -0,0 +1,70 @@
|
|||
users = {
|
||||
'mautrix-whatsapp': {
|
||||
'home': '/opt/mautrix-whatsapp',
|
||||
},
|
||||
}
|
||||
|
||||
directories = {
|
||||
'/opt/mautrix-whatsapp/src': {},
|
||||
'/opt/mautrix-whatsapp/logs': {
|
||||
'owner': 'mautrix-whatsapp',
|
||||
},
|
||||
}
|
||||
|
||||
git_deploy = {
|
||||
'/opt/mautrix-whatsapp/src': {
|
||||
'repo': 'https://github.com/tulir/mautrix-whatsapp.git',
|
||||
'rev': node.metadata['mautrix-whatsapp']['version'],
|
||||
'triggers': {
|
||||
'action:mautrix-whatsapp_build',
|
||||
'svc_systemd:mautrix-whatsapp:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
actions = {
|
||||
'mautrix-whatsapp_build': {
|
||||
'command': 'cd /opt/mautrix-whatsapp/src && go build',
|
||||
'triggered': True,
|
||||
'needs': {
|
||||
'pkg_apt:golang-go',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'mautrix-whatsapp': {
|
||||
'needs': {
|
||||
'action:mautrix-whatsapp_build',
|
||||
'directory:/opt/mautrix-whatsapp/logs',
|
||||
'file:/etc/systemd/system/mautrix-whatsapp.service',
|
||||
'file:/opt/mautrix-whatsapp/config.yaml',
|
||||
'postgres_db:mautrix-whatsapp',
|
||||
'postgres_role:mautrix-whatsapp',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
files = {
|
||||
'/opt/mautrix-whatsapp/registration.yaml': {
|
||||
'content_type': 'mako',
|
||||
'triggers': {
|
||||
'svc_systemd:mautrix-whatsapp:restart',
|
||||
},
|
||||
},
|
||||
'/opt/mautrix-whatsapp/config.yaml': {
|
||||
'content_type': 'mako',
|
||||
'triggers': {
|
||||
'svc_systemd:mautrix-whatsapp:restart',
|
||||
},
|
||||
},
|
||||
'/etc/systemd/system/mautrix-whatsapp.service': {
|
||||
'triggers': {
|
||||
'action:systemd-reload',
|
||||
'svc_systemd:mautrix-whatsapp:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if node.has_bundle('matrix-synapse'):
|
||||
files['/opt/mautrix-whatsapp/registration.yaml']['triggers'].add('svc_systemd:matrix-synapse:restart')
|
Loading…
Add table
Add a link
Reference in a new issue