Update the script to use the systemwide matrix-commander
This commit is contained in:
parent
9c5defda16
commit
414eb15df2
1 changed files with 5 additions and 3 deletions
|
@ -4,13 +4,12 @@
|
|||
|
||||
import argparse
|
||||
from datetime import date
|
||||
from collections import defaultdict
|
||||
from functools import lru_cache
|
||||
import logging
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
from typing import Union, Dict, Any, List, Tuple
|
||||
from typing import Union, Dict, List, Tuple
|
||||
from urllib.parse import quote
|
||||
|
||||
import git
|
||||
|
@ -22,7 +21,9 @@ import sarge
|
|||
|
||||
API_URL = "https://invent.kde.org/api/v4/projects/"
|
||||
OBS_URL = "https://api.opensuse.org/trigger/runservice"
|
||||
MATRIX_COMMANDER = "/home/mocker/local-venv/bin/matrix-commander.py"
|
||||
MATRIX_COMMANDER = "/usr/local/bin/matrix-commander.py"
|
||||
CREDENTIALS_FILE = "/etc/matrix-commander/credentials.json"
|
||||
STORE_DIR = "/var/lib/matrix-commander/store"
|
||||
REPO_TEMPLATE = "https://invent.kde.org/{}"
|
||||
|
||||
MESSAGE_TEMPLATE = """
|
||||
|
@ -177,6 +178,7 @@ def notify_matrix(update_data: Dict[str, List[Tuple[str, str]]]) -> None:
|
|||
message = template.render(repositories=update_data, date=date)
|
||||
|
||||
cmd = [MATRIX_COMMANDER, "--markdown", "--log-level", "ERROR",
|
||||
"--credentials", CREDENTIALS_FILE, "--store", STORE_DIR,
|
||||
"-m", message]
|
||||
logging.debug("Sending Matrix notification")
|
||||
sarge.run(cmd, stdout=subprocess.DEVNULL)
|
||||
|
|
Loading…
Add table
Reference in a new issue