diff --git a/obs/update_unstable.py b/obs/update_unstable.py index 01f2712..d8f7cdf 100755 --- a/obs/update_unstable.py +++ b/obs/update_unstable.py @@ -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)