28 lines
910 B
Python
28 lines
910 B
Python
from typing import Annotated
|
|
|
|
from injectable import injectable, autowired, Autowired
|
|
|
|
from app.model.healthcheck import HealthCheck
|
|
from app.model.webhook import WebhookEvent
|
|
from app.services import DockerService, GitService, Passwords
|
|
|
|
|
|
@injectable
|
|
class WebhookProcessor:
|
|
@autowired
|
|
def __init__(self, docker: Annotated[DockerService, Autowired],
|
|
git: Annotated[GitService, Autowired],
|
|
keepass: Annotated[Passwords, Autowired]):
|
|
self._docker = docker
|
|
self._git = git
|
|
self._keepass = keepass
|
|
|
|
def process_ci_event(self, event: WebhookEvent):
|
|
pass
|
|
|
|
@property
|
|
def health(self) -> HealthCheck:
|
|
return HealthCheck(
|
|
self._docker is not None and self._git is not None and self._keepass is not None,
|
|
f"Docker: {self._docker is not None}, Git: {self._git is not None}, KeePass: {self._keepass is not None}"
|
|
)
|