bundles/mautrix-telegram: install bridge from git repository

This commit is contained in:
Franzi 2020-11-07 09:39:57 +01:00
parent d7f578742b
commit 7ab121e7e5
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 28 additions and 8 deletions

View file

@ -7,9 +7,11 @@ User=mautrix-telegram
Group=mautrix-telegram
Environment="VIRTUAL_ENV=/opt/mautrix-telegram/venv"
Environment="PATH=/opt/mautrix-telegram/venv/bin:/usr/local/bin:/usr/bin:/bin"
Environment="FFMPEG_BINARY=/usr/bin/ffmpeg"
ExecStart=/opt/mautrix-telegram/venv/bin/python -m mautrix_telegram -c /opt/mautrix-telegram/config.yaml
WorkingDirectory=/opt/mautrix-telegram
WorkingDirectory=/opt/mautrix-telegram/src
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target

View file

@ -10,12 +10,21 @@ actions = {
'command': '/opt/mautrix-telegram/venv/bin/alembic -c /opt/mautrix-telegram/alembic.ini -x /opt/mautrix-telegram/config.yaml init /opt/mautrix-telegram/alembic',
'unless': 'test -d /opt/mautrix-telegram/alembic',
'needs': {
'action:mautrix-telegram_create_virtualenv',
'file:/opt/mautrix-telegram/alembic.ini',
},
},
'mautrix-telegram_upgrade_database': {
'command': '/opt/mautrix-telegram/venv/bin/alembic -c /opt/mautrix-telegram/alembic.ini -x /opt/mautrix-telegram/config.yaml upgrade head',
'mautrix-telegram_install_bridge': {
'command': 'cd /opt/mautrix-telegram/src && /opt/mautrix-telegram/venv/bin/pip install --upgrade .[all]',
'needs': {
'action:mautrix-telegram_create_virtualenv',
},
'triggered': True,
},
'mautrix-telegram_upgrade_database': {
'command': '/opt/mautrix-telegram/venv/bin/alembic -c /opt/mautrix-telegram/alembic.ini -x config=/opt/mautrix-telegram/config.yaml upgrade head',
'needs': {
'action:mautrix-telegram_create_virtualenv',
'action:mautrix-telegram_init_alembic',
'postgres_db:mautrix-telegram',
'postgres_role:mautrix-telegram',
@ -24,12 +33,16 @@ actions = {
},
}
pkg_pip = {
'/opt/mautrix-telegram/venv/mautrix-telegram': {
'needs': {
'action:mautrix-telegram_create_virtualenv',
},
directories = {
'/opt/mautrix-telegram/src': {},
}
git_deploy = {
'/opt/mautrix-telegram/src': {
'repo': 'https://github.com/tulir/mautrix-telegram.git',
'rev': 'master',
'triggers': {
'action:mautrix-telegram_install_bridge',
'action:mautrix-telegram_upgrade_database',
'svc_systemd:mautrix-telegram:restart',
},

View file

@ -1,4 +1,9 @@
defaults = {
'apt': {
'packages': {
'ffmpeg': {},
},
},
'users': {
'mautrix-telegram': {
'home': '/opt/mautrix-telegram',