Skip to content

Commit

Permalink
Merge pull request #1 from LookACastle/136-degreasing-racetrack
Browse files Browse the repository at this point in the history
Rename fatman to job
  • Loading branch information
iszulcdeepsense authored Feb 22, 2023
2 parents e9a31fe + abddab4 commit 85a9a54
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand Down
2 changes: 1 addition & 1 deletion teams-notifier/plugin-manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name: teams-notifier
version: 1.1.0
version: 1.2.0
14 changes: 7 additions & 7 deletions teams-notifier/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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]:
"""
Expand Down

0 comments on commit 85a9a54

Please sign in to comment.