QuasarAppCI/BuildBotLib/buildBotServices.py

30 lines
1.1 KiB
Python
Raw Normal View History

2019-07-22 10:20:59 +03:00
# This Python file uses the following encoding: utf-8
2019-12-26 13:48:06 +03:00
from BuildBotLib.buildBotModule import BuildBotModule
2019-07-22 17:17:44 +03:00
from buildbot.plugins import reporters, util
2019-12-26 13:48:06 +03:00
from BuildBotLib.secretManager import SecretManager
2019-07-22 10:20:59 +03:00
2019-12-26 13:48:06 +03:00
class BuildBotServices(BuildBotModule):
2020-06-19 11:09:23 +03:00
def __init__(self, masterConf):
BuildBotModule.__init__(self, masterConf)
2019-07-22 10:20:59 +03:00
2019-12-26 13:48:06 +03:00
# BUILDBOT SERVICES
2019-07-22 10:20:59 +03:00
2019-12-26 13:48:06 +03:00
# 'services' is a list of BuildbotService
# items like reporter targets. The
# status of each build will be pushed to these targets.
# buildbot/reporters/*.py
2019-07-22 10:20:59 +03:00
# has a variety to choose from, like IRC bots.
self.masterConf['services'] = []
2019-07-22 17:17:44 +03:00
secret = SecretManager("/home/andrei/buildBotSecret/secret.json")
2019-07-22 10:20:59 +03:00
2019-08-21 14:34:47 +03:00
contextVal = util.Interpolate("buildbot/%(prop:buildername)s")
2019-08-21 14:30:25 +03:00
gc = reporters.GitHubStatusPush(token=secret.getValue('gitHub'),
2019-12-26 13:48:06 +03:00
context=contextVal,
verbose=True,
startDescription='Build started.',
endDescription='Build done.')
2019-07-22 10:20:59 +03:00
self.masterConf['services'].append(gc)