Skip to content

Instantly share code, notes, and snippets.

@mdellavo
Created February 13, 2019 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdellavo/fbca1e81009eb39ca25963233b8258d4 to your computer and use it in GitHub Desktop.
Save mdellavo/fbca1e81009eb39ca25963233b8258d4 to your computer and use it in GitHub Desktop.
Buildbot plugin to post build notifications to slack
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