Created
February 13, 2019 16:45
-
-
Save mdellavo/fbca1e81009eb39ca25963233b8258d4 to your computer and use it in GitHub Desktop.
Buildbot plugin to post build notifications to slack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SlackStatusBot(NotifierBase): | |
name = "SlackStatusBot" | |
def __init__(self, webhook_url): | |
super(SlackStatusBot, self).__init__(mode="all", watchedWorkers="all") | |
self.webhook_url = webhook_url | |
def isWorkerMessageNeeded(self, worker): | |
return True | |
def isMessageNeeded(self, build): | |
return True | |
def sendMessage(self, body, subject=None, type=None, builderName=None, | |
results=None, builds=None, users=None, patches=None, | |
logs=None, worker=None): | |
requests.post(self.webhook_url, json={"text": body}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment