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
|
||||
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
|
||||
|
|
|
@ -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',
|
||||
},
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
defaults = {
|
||||
'apt': {
|
||||
'packages': {
|
||||
'ffmpeg': {},
|
||||
},
|
||||
},
|
||||
'users': {
|
||||
'mautrix-telegram': {
|
||||
'home': '/opt/mautrix-telegram',
|
||||
|
|
Loading…
Reference in a new issue