-
Notifications
You must be signed in to change notification settings - Fork 2
/
master.cfg
186 lines (147 loc) · 7.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# -*- python -*-
# ex: set filetype=python:
from buildbot.plugins import *
# This is a sample buildmaster config file. It must be installed as
# 'master.cfg' in your buildmaster's base directory.
# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {}
####### 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.
import iwyu
c['workers'] = [
iwyu.EC2LatentWorker("ubuntu-18_04-bot-ephemeral", "*masked*",
"/path/to/aws_credentials.txt", "us-west-2",
"buildbot-worker-ubuntu"),
]
# '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}}
####### CHANGESOURCES
# the 'change_source' setting tells the buildmaster how it should find out
# about source code changes. Here we point to the buildbot version of a python hello-world project.
c['change_source'] = []
c['change_source'].append(changes.GitPoller(
repourl="https://github.com/llvm/llvm-project.git",
project="llvm", pollinterval=30 * 60))
c['change_source'].append(changes.GitPoller(
repourl="https://github.com/include-what-you-use/include-what-you-use.git",
project="iwyu", pollinterval=30 * 60))
####### SCHEDULERS
# Configure the Schedulers, which decide how to react to incoming changes. In this
# case, just kick off a 'runtests' build
import time
all_builder_names = ["ubuntu-18_04-builder"]
c['schedulers'] = []
c['schedulers'].append(schedulers.Nightly(
name="iwyu",
builderNames=all_builder_names,
# All pollers should trigger a build.
change_filter=util.ChangeFilter(project=['iwyu', 'llvm']),
hour=int((4 - time.timezone / (60 * 60)) % 24),
minute=0, # 04:00 UTC == 20:00 PST
onlyIfChanged=True))
c['schedulers'].append(schedulers.ForceScheduler(
name="force",
builderNames=all_builder_names))
####### BUILDERS
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
# what steps, and which workers can execute them. Note that any particular build will
# only take place on one worker.
import os
WORKSPACE_PATH = "/mnt/buildbot_iwyu_trunk/workspace"
ubuntu_factory = util.BuildFactory()
ubuntu_factory.addStep(steps.ShellCommand(
name="update LLVM+Clang", description="updating LLVM+Clang", descriptionDone="update LLVM+Clang",
workdir=os.path.join(WORKSPACE_PATH, "sources/llvm/"),
command=["git", "pull"]))
ubuntu_factory.addStep(steps.ShellCommand(
name="clean LLVM+Clang artifacts", description="cleaning LLVM+Clang artifacts", descriptionDone="clean LLVM+Clang artifacts",
command=["rm", "-rf", os.path.join(WORKSPACE_PATH, "installed/")]))
ubuntu_factory.addStep(steps.ShellCommand(
name="clean LLVM+Clang", description="cleaning LLVM+Clang", descriptionDone="clean LLVM+Clang",
command=["ninja", "-C", os.path.join(WORKSPACE_PATH, "build_llvm/"), "clean"]))
ubuntu_factory.addStep(steps.Compile(
name="compile LLVM+Clang", description="compiling LLVM+Clang", descriptionDone="compile LLVM+Clang",
haltOnFailure=True,
command=["ninja", "-C", os.path.join(WORKSPACE_PATH, "build_llvm/"), "install"]))
ubuntu_factory.addStep(steps.ShellCommand(
name="update IWYU", description="updating IWYU", descriptionDone="update IWYU",
workdir=os.path.join(WORKSPACE_PATH, "sources/iwyu/"),
command=["git", "pull"]))
ubuntu_factory.addStep(steps.ShellCommand(
name="clean IWYU", description="cleaning IWYU", descriptionDone="clean IWYU",
haltOnFailure=True,
command=["ninja", "-C", os.path.join(WORKSPACE_PATH, "build_iwyu/"), "clean"]))
ubuntu_factory.addStep(steps.Compile(
name="compile IWYU", description="compiling IWYU", descriptionDone="compile IWYU",
haltOnFailure=True,
command=["ninja", "-C", os.path.join(WORKSPACE_PATH, "build_iwyu/"), "install"]))
ubuntu_factory.addStep(steps.ShellCommand(
name="test IWYU", description="testing IWYU", descriptionDone="test IWYU",
haltOnFailure=True,
command=[os.path.join(WORKSPACE_PATH, "sources/iwyu/run_iwyu_tests.py")],
workdir=os.path.join(WORKSPACE_PATH, "sources/iwyu/"),
env={"PATH": [os.path.join(WORKSPACE_PATH, "installed/bin"), "${PATH}"]}))
ubuntu_factory.addStep(steps.ShellCommand(
name="test fix_includes", description="testing fix_includes.py", descriptionDone="test fix_includes",
haltOnFailure=True,
command=[os.path.join(WORKSPACE_PATH, "sources/iwyu/fix_includes_test.py")]))
ubuntu_factory.addStep(steps.ShellCommand(
name="test iwyu_tool", description="testing iwyu_tool.py", descriptionDone="test iwyu_tool",
haltOnFailure=True,
command=[os.path.join(WORKSPACE_PATH, "sources/iwyu/iwyu_tool_test.py")]))
c['builders'] = []
c['builders'].append(
util.BuilderConfig(name="ubuntu-18_04-builder",
workernames=["ubuntu-18_04-bot-ephemeral"],
factory=ubuntu_factory))
####### 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.
c['services'] = []
c['services'].append(reporters.MailNotifier(
fromaddr="[email protected]",
sendToInterestedUsers=False,
mode=("failing",),
extraRecipients=["[email protected]"],
relayhost="mail.gandi.net",
smtpUser="*masked*",
smtpPassword="*masked*"))
####### PROJECT IDENTITY
# the 'title' string will appear at the top of this buildbot installation's
# home pages (linked to the 'titleURL').
c['title'] = "include-what-you-use"
c['titleURL'] = "https://include-what-you-use.org"
# 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'] = "http://buildbot.include-what-you-use.org:8010/"
# minimalistic config to activate new web UI
c['www'] = dict(port=8010,
plugins=dict(waterfall_view={}, console_view={}, grid_view={}))
authz = util.Authz(
allowRules=[
util.AnyControlEndpointMatcher(role="admins"),
],
roleMatchers=[
util.RolesFromUsername(roles=["admins"], usernames=["*masked*"])
]
)
auth = util.UserPasswordAuth({'*masked*': '*masked*'})
c['www']['auth'] = auth
c['www']['authz'] = authz
c['buildbotNetUsageData'] = None
####### 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': "sqlite:///state.sqlite",
}