Caution
Buildbot no longer supports Python 2.7 on the Buildbot master.
2.5.14.9. GitHubStatusPush¶
from buildbot.plugins import reporters, util
context = Interpolate("buildbot/%(prop:buildername)s")
gs = reporters.GitHubStatusPush(token='githubAPIToken',
context=context,
startDescription='Build started.',
endDescription='Build done.')
factory = util.BuildFactory()
buildbot_bbtools = util.BuilderConfig(
name='builder-name',
workernames=['worker1'],
factory=factory)
c['builders'].append(buildbot_bbtools)
c['services'].append(gs)
GitHubStatusPush
publishes a build status using GitHub Status API.
It requires txrequests package to allow interaction with GitHub REST API.
It is configured with at least a GitHub API token.
You can create a token from your own GitHub - Profile - Applications - Register new application or use an external tool to generate one.
-
class
buildbot.reporters.github.
GitHubStatusPush
(token, startDescription=None, endDescription=None, context=None, baseURL=None, verbose=False, builders=None)¶ - Parameters
token (string) – token used for authentication. (can be a Secret)
string startDescription (rendereable) – Custom start message (default: ‘Build started.’)
string endDescription (rendereable) – Custom end message (default: ‘Build done.’)
string context (rendereable) – Passed to GitHub to differentiate between statuses. A static string can be passed or
Interpolate
for dynamic substitution. The default context is buildbot/%(prop:buildername)s.baseURL (string) – specify the github api endpoint if you work with GitHub Enterprise
verbose (boolean) – if True, logs a message for each successful status push
builders (list) – only send update for specified builders