-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathmaster_common.py
79 lines (75 loc) · 3.13 KB
/
master_common.py
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
import os
from buildbot.plugins import reporters, secrets, util
from constants import GITHUB_STATUS_BUILDERS
from schedulers_definition import SCHEDULERS
def base_master_config(
config: dict,
title=os.environ["TITLE"],
title_url=os.environ["TITLE_URL"],
buildbot_url=os.environ["BUILDMASTER_URL"],
secrets_provider_file=os.environ["MASTER_CREDENTIALS_DIR"],
master_port=os.environ["PORT"],
mq_router_url=os.environ["MQ_ROUTER_URL"],
):
# TODO(cvicentiu) either move this to environ or all other params to config
# file.
github_access_token = config["private"]["gh_mdbci"]["access_token"]
db_url = config["private"]["db_url"]
return {
#######
# PROJECT IDENTITY
#######
# the 'title' string will appear at the top of this buildbot
# installation's
"title": title,
# home pages (linked to the 'titleURL').
"titleURL": 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.
"buildbotURL": buildbot_url,
# '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.
"services": [
reporters.GitHubStatusPush(
token=github_access_token,
context=util.Interpolate("buildbot/%(prop:buildername)s"),
startDescription="Build started.",
endDescription="Build done.",
verbose=True,
builders=GITHUB_STATUS_BUILDERS,
)
],
"secretsProviders": [secrets.SecretInAFile(dirname=secrets_provider_file)],
# '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)
"protocols": {
"pb": {"port": int(master_port)}, # master_port must be int
},
# This specifies what database buildbot uses to store its state.
"db": {
"db_url": db_url,
},
# Disable net usage reports from being sent to buildbot.net
"buildbotNetUsageData": None,
# Configure the Schedulers, which decide how to react to incoming
# changes.
"schedulers": SCHEDULERS,
"logEncoding": "utf-8",
"multiMaster": True,
"mq": {
# Need to enable multimaster aware mq. Wamp is the only option for
# now.
"type": "wamp",
"router_url": mq_router_url,
"realm": "realm1",
# valid are: none, critical, error, warn, info, debug, trace
"wamp_debug_level": "info",
},
}