-
Notifications
You must be signed in to change notification settings - Fork 9
/
master.cfg
159 lines (122 loc) · 5.04 KB
/
master.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# -*- python -*-
# ex: set filetype=python:
from buildbot.plugins import *
from buildbot.process.properties import Interpolate
from config.builders import builders
from config.schedulers import schedulers
from config.sources import sources
from config.settings import get_workers
import os
# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {
'change_source': sources,
'builders': builders,
'schedulers': schedulers
}
####### WORKERS
# The 'workers' list defines the set of recognized workers. Each element is
# a Worker object, specifying a unique worker name and password. The same
# worker name and password must be configured on the worker.
c['workers'] = []
wl = get_workers()
for wkr in wl:
max_builds = 4
if "max_builds" in wkr:
max_builds = wkr["max_builds"]
print("INFO: Add worker %s" % wkr["name"])
c['workers'].append(worker.Worker(wkr["name"], wkr["pass"], max_builds=max_builds))
# 'protocols' contains information about protocols which master will use for
# communicating with workers. You must define at least 'port' option that workers
# could connect to your master with this protocol.
# 'port' must match the value configured into the workers (with their
# --master option)
c['protocols'] = {'pb': {'port': 9989}}
####### BUILDBOT SERVICES
# 'services' is a list of BuildbotService items like reporter targets. The
# status of each build will be pushed to these targets. buildbot/reporters/*.py
# has a variety to choose from, like IRC bots.
context = Interpolate("buildbot/%(prop:buildername)s")
gs = reporters.GitHubStatusPush(token=os.environ.get("BUILDBOT_STATUS_TOKEN"),
context=context,
verbose=True)
c['services'] = []
irc = reporters.IRC(host=os.environ.get('IRC_HOST'), nick=os.environ.get('IRC_NICK'),
channels=[os.environ.get('IRC_CHANNELS')],
noticeOnChannel=True,
notify_events={
'started': 1,
'success': 1,
'failure': 1,
'exception': 1,
})
c['services'].append(irc)
template = u'''\
<h4>Build status: {{ summary }}</h4>
<p> Worker used: {{ workername }}</p>
{% for step in build['steps'] %}
<p> {{ step['name'] }}: {{ step['result'] }}</p>
{% endfor %}
<p><b> -- Gentoo Kernel-CI Buildbot</b></p>
'''
#mn = reporters.MailNotifier(fromaddr="[email protected]",
# sendToInterestedUsers=False,
# mode=('all'),
# extraRecipients=['[email protected]',
# '[email protected]'],
# messageFormatter=reporters.MessageFormatter(
# template=template, template_type='html',
# wantProperties=True, wantSteps=True),
# relayhost="mail.alicef.me",
# smtpPort=465, smtpUser="[email protected]",
# smtpPassword=os.environ.get('MAIL_PASSWORD'))
#c['services'].append(mn)
c['services'].append(gs)
####### PROJECT IDENTITY
# the 'title' string will appear at the top of this buildbot installation's
# home pages (linked to the 'titleURL').
c['title'] = os.environ.get('GKERNELCI_TITLE')
c['titleURL'] = os.environ.get('GKERNELCI_TITLE_URL')
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server is visible. This typically uses the port number set in
# the 'www' entry below, but with an externally-visible host name which the
# buildbot cannot figure out without some help.
c['buildbotURL'] = os.environ.get('GKERNELCI_URL')
c['buildbotNetUsageData'] = None
# minimalistic config to activate new web UI
c['www'] = {
'port': 8010,
'plugins': { 'waterfall_view': True,
'console_view': True,
'grid_view': True,
'tyrian_view': True }
}
c['www']['authz'] = util.Authz(
allowRules=[
util.AnyEndpointMatcher(role="admins", defaultDeny=False),
util.AnyControlEndpointMatcher(role="admins")
],
roleMatchers=[
util.RolesFromUsername(roles=['admins'], usernames=[os.environ.get('WWW_AUTH_USER')])
]
)
PR_props = [
"github.base.ref",
"github.number",
"github.mergeable",
]
c['www']['allowed_origins'] = ["*"]
c['www']['change_hook_dialects'] = {
"github": {
"secret": os.environ.get("BUILDBOT_HOOK_TOKEN"),
"strict": True,
"github_property_whitelist": PR_props
}
}
c['www']['auth'] = util.UserPasswordAuth([(os.environ.get('WWW_AUTH_USER'),os.environ.get('WWW_AUTH_PASWD'))])
####### DB URL
c['db'] = {
# This specifies what database buildbot uses to store its state. You can
# leave this at its default for all but the largest installations.
'db_url' : os.environ.get("BUILDBOT_DB_URL", "sqlite://").format(**os.environ),
}