bundles/mautrix-whatsapp: use precompiled binary

This commit is contained in:
Franzi 2021-11-09 17:57:52 +01:00
parent 4a4f45bc9d
commit 33b6700848
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 12 additions and 27 deletions

View file

@ -6,8 +6,8 @@ Requires=postgresql.service
[Service] [Service]
User=mautrix-whatsapp User=mautrix-whatsapp
Group=mautrix-whatsapp Group=mautrix-whatsapp
ExecStart=/opt/mautrix-whatsapp/src/mautrix-whatsapp --config /opt/mautrix-whatsapp/config.yaml --registration /opt/mautrix-whatsapp/registration.yaml ExecStart=/opt/mautrix-whatsapp/mautrix-whatsapp --config /opt/mautrix-whatsapp/config.yaml --registration /opt/mautrix-whatsapp/registration.yaml
WorkingDirectory=/opt/mautrix-whatsapp/src WorkingDirectory=/opt/mautrix-whatsapp
Restart=always Restart=always
RestartSec=10 RestartSec=10

View file

@ -6,40 +6,17 @@ users = {
directories = { directories = {
'/opt/mautrix-whatsapp': {}, '/opt/mautrix-whatsapp': {},
'/opt/mautrix-whatsapp/src': {},
'/opt/mautrix-whatsapp/logs': { '/opt/mautrix-whatsapp/logs': {
'owner': 'mautrix-whatsapp', 'owner': 'mautrix-whatsapp',
}, },
} }
git_deploy = {
'/opt/mautrix-whatsapp/src': {
'repo': 'https://github.com/mautrix/whatsapp.git',
'rev': node.metadata.get('mautrix-whatsapp/version'),
'triggers': {
'action:mautrix-whatsapp_build',
'svc_systemd:mautrix-whatsapp:restart',
},
},
}
actions = {
'mautrix-whatsapp_build': {
'command': 'cd /opt/mautrix-whatsapp/src && GOMAXPROCS=$(nproc) go build',
'triggered': True,
'needs': {
'pkg_apt:golang-go',
},
},
}
svc_systemd = { svc_systemd = {
'mautrix-whatsapp': { 'mautrix-whatsapp': {
'needs': { 'needs': {
'action:mautrix-whatsapp_build',
'directory:/opt/mautrix-whatsapp/logs', 'directory:/opt/mautrix-whatsapp/logs',
'file:/etc/systemd/system/mautrix-whatsapp.service', 'file:/etc/systemd/system/mautrix-whatsapp.service',
'file:/opt/mautrix-whatsapp/config.yaml', 'file:/opt/mautrix-whatsapp/config.yaml',
'file:/opt/mautrix-whatsapp/mautrix-whatsapp',
'postgres_db:mautrix-whatsapp', 'postgres_db:mautrix-whatsapp',
'postgres_role:mautrix-whatsapp', 'postgres_role:mautrix-whatsapp',
}, },
@ -65,6 +42,15 @@ files = {
'svc_systemd:mautrix-whatsapp:restart', 'svc_systemd:mautrix-whatsapp:restart',
}, },
}, },
'/opt/mautrix-whatsapp/mautrix-whatsapp': {
'content_hash': node.metadata.get('mautrix-whatsapp/sha1', None),
'content_type': 'download',
'mode': '0755',
'source': 'https://github.com/mautrix/whatsapp/releases/download/{}/mautrix-whatsapp-amd64'.format(node.metadata.get('mautrix-whatsapp/version')),
'triggers': {
'svc_systemd:mautrix-whatsapp:restart',
},
},
} }
if node.has_bundle('matrix-synapse'): if node.has_bundle('matrix-synapse'):

View file

@ -2,7 +2,6 @@ defaults = {
'apt': { 'apt': {
'packages': { 'packages': {
'libolm-dev': {}, 'libolm-dev': {},
'golang-go': {},
}, },
}, },
'cron': { 'cron': {