bundles/mautrix-telegram: install bridge from git repository
This commit is contained in:
parent
d7f578742b
commit
7ab121e7e5
3 changed files with 28 additions and 8 deletions
|
@ -7,9 +7,11 @@ User=mautrix-telegram
|
||||||
Group=mautrix-telegram
|
Group=mautrix-telegram
|
||||||
Environment="VIRTUAL_ENV=/opt/mautrix-telegram/venv"
|
Environment="VIRTUAL_ENV=/opt/mautrix-telegram/venv"
|
||||||
Environment="PATH=/opt/mautrix-telegram/venv/bin:/usr/local/bin:/usr/bin:/bin"
|
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
|
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
|
Restart=on-failure
|
||||||
|
RestartSec=10
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -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',
|
'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',
|
'unless': 'test -d /opt/mautrix-telegram/alembic',
|
||||||
'needs': {
|
'needs': {
|
||||||
|
'action:mautrix-telegram_create_virtualenv',
|
||||||
'file:/opt/mautrix-telegram/alembic.ini',
|
'file:/opt/mautrix-telegram/alembic.ini',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'mautrix-telegram_upgrade_database': {
|
'mautrix-telegram_install_bridge': {
|
||||||
'command': '/opt/mautrix-telegram/venv/bin/alembic -c /opt/mautrix-telegram/alembic.ini -x /opt/mautrix-telegram/config.yaml upgrade head',
|
'command': 'cd /opt/mautrix-telegram/src && /opt/mautrix-telegram/venv/bin/pip install --upgrade .[all]',
|
||||||
'needs': {
|
'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',
|
'action:mautrix-telegram_init_alembic',
|
||||||
'postgres_db:mautrix-telegram',
|
'postgres_db:mautrix-telegram',
|
||||||
'postgres_role:mautrix-telegram',
|
'postgres_role:mautrix-telegram',
|
||||||
|
@ -24,12 +33,16 @@ actions = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_pip = {
|
directories = {
|
||||||
'/opt/mautrix-telegram/venv/mautrix-telegram': {
|
'/opt/mautrix-telegram/src': {},
|
||||||
'needs': {
|
}
|
||||||
'action:mautrix-telegram_create_virtualenv',
|
|
||||||
},
|
git_deploy = {
|
||||||
|
'/opt/mautrix-telegram/src': {
|
||||||
|
'repo': 'https://github.com/tulir/mautrix-telegram.git',
|
||||||
|
'rev': 'master',
|
||||||
'triggers': {
|
'triggers': {
|
||||||
|
'action:mautrix-telegram_install_bridge',
|
||||||
'action:mautrix-telegram_upgrade_database',
|
'action:mautrix-telegram_upgrade_database',
|
||||||
'svc_systemd:mautrix-telegram:restart',
|
'svc_systemd:mautrix-telegram:restart',
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
defaults = {
|
defaults = {
|
||||||
|
'apt': {
|
||||||
|
'packages': {
|
||||||
|
'ffmpeg': {},
|
||||||
|
},
|
||||||
|
},
|
||||||
'users': {
|
'users': {
|
||||||
'mautrix-telegram': {
|
'mautrix-telegram': {
|
||||||
'home': '/opt/mautrix-telegram',
|
'home': '/opt/mautrix-telegram',
|
||||||
|
|
Loading…
Reference in a new issue