From dddfbb3d48c0bf56d0a8f4640874dca5c4fbd09a Mon Sep 17 00:00:00 2001 From: Thor Kikkenborg Date: Fri, 10 Feb 2023 11:09:58 +0100 Subject: [PATCH 1/2] Degrease teams notifications --- README.md | 4 ++-- teams-notifier/plugin.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ef8d4fa..c4465c1 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ This plugin sends Racetrack notifications to Teams channel. It sends events when: -- job is submitted (fatman deployed) -- fatman is deleted +- job is submitted (job deployed) +- job is deleted ## Setup 1. Create webhook for a Teams channel - diff --git a/teams-notifier/plugin.py b/teams-notifier/plugin.py index b5f8739..65781bc 100644 --- a/teams-notifier/plugin.py +++ b/teams-notifier/plugin.py @@ -5,7 +5,7 @@ import pymsteams from racetrack_client.manifest import Manifest -from racetrack_commons.entities.dto import FatmanDto +from racetrack_commons.entities.dto import JobDto class Plugin: @@ -14,15 +14,15 @@ def __init__(self) -> None: self.webhook_url = os.environ.get('TEAMS_WEBHOOK') assert self.webhook_url, 'TEAMS_WEBHOOK env var was not set' - def post_fatman_deploy(self, manifest: Manifest, fatman: FatmanDto, image_name: str, deployer_username: str = None): - """Supplementary actions invoked after fatman is deployed""" + def post_job_deploy(self, manifest: Manifest, job: JobDto, image_name: str, deployer_username: str = None): + """Supplementary actions invoked after job is deployed""" cluster = os.environ.get('CLUSTER_FQDN') - self._send_notification(f'Fatman {fatman} has been deployed to {cluster} cluster by {deployer_username}') + self._send_notification(f'Job {job} has been deployed to {cluster} cluster by {deployer_username}') - def post_fatman_delete(self, fatman: FatmanDto, username_executor: str = None): - """Supplementary actions invoked after fatman is deleted""" + def post_job_delete(self, job: JobDto, username_executor: str = None): + """Supplementary actions invoked after job is deleted""" cluster = os.environ.get('CLUSTER_FQDN') - self._send_notification(f'Fatman {fatman} has been deleted from {cluster} cluster by {username_executor}') + self._send_notification(f'Job {job} has been deleted from {cluster} cluster by {username_executor}') def markdown_docs(self) -> Optional[str]: """ From abddab4e8bcbaacb274523fb9b82aa2fb8cb0081 Mon Sep 17 00:00:00 2001 From: Thor Kikkenborg Date: Fri, 10 Feb 2023 11:10:07 +0100 Subject: [PATCH 2/2] bump version --- teams-notifier/plugin-manifest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teams-notifier/plugin-manifest.yaml b/teams-notifier/plugin-manifest.yaml index 19e8d49..d5791c2 100644 --- a/teams-notifier/plugin-manifest.yaml +++ b/teams-notifier/plugin-manifest.yaml @@ -1,2 +1,2 @@ name: teams-notifier -version: 1.1.0 +version: 1.2.0