-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmaster.cfg
634 lines (543 loc) · 21.3 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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
import os
from buildbatter.build import BuildManager, GitBranch, SVNBranch, \
BuildTarget, PythonModuleBuildRules, BuildRules
from buildbatter.multirepo import SVN
from buildbatter.steps import EasyInstall, UploadDist, RotateFiles, NoseTests, \
BuildEgg, BuildSDist
from buildbatter.util import create_slave_list
from buildbot.process import factory
from buildbot.process.properties import WithProperties
from buildbot.scheduler import Nightly
from buildbot.status import words
from buildbot.steps.shell import ShellCommand, Test
from buildbot.steps.transfer import FileUpload, FileDownload
from buildbot.steps.python import PyFlakes
PUBLIC_HTML_DIR = os.path.join(os.path.dirname(__file__), "public_html")
MIRROR_PATH = "/var/www/downloads.reviewboard.org/htdocs/mirror"
BLEEDING_EDGE_PATH = "/var/www/downloads.reviewboard.org/htdocs/bleeding"
NIGHTLY_PATH = "/var/www/downloads.reviewboard.org/htdocs/nightlies"
MIRROR_URL = "http://downloads.reviewboard.org/mirror/"
BLEEDING_EDGE_URL = "http://downloads.reviewboard.org/bleeding/"
DJANGO_SVN_ROOT = "http://code.djangoproject.com/svn/django"
RB_WEBSITE_DIR = '/var/www/reviewboard.org/'
RB_EXCLUDES = [
'reviewboard_1.6_django_trunk_py2.4',
'reviewboard_django_trunk_py2.4',
'reviewboard_django_1.3_py2.4',
'reviewboard_django_1.3_py2.5',
'reviewboard_django_1.3_py2.6',
'djblets_django_1.3_py2.4',
'djblets_django_trunk_py2.4',
'django-evolution_django_trunk_py2.4',
'rb_nightly_django_trunk_py2.4',
]
TRIGGER_EXCLUDES = [
'triggered_%s' % exclude
for exclude in RB_EXCLUDES
]
RELEASE_PY_VER = "2.7"
# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {}
c['administrators'] = (
)
slaves, slave_info = create_slave_list()
c['slaves'] = slaves
# 'slavePortnum' defines the TCP port to listen on. This must match the value
# configured into the buildslaves (with their --master option)
c['slavePortnum'] = 9989
# Specify the location to find the eggs for easy_install
#EasyInstall.pypi_url = 'http://downloads.reviewboard.org:8887/'
#EasyInstall.allow_hosts_pattern = '*downloads.reviewboard.org*'
class RBProjectBuildRules(PythonModuleBuildRules):
def __init__(self, dist_basename=None, upload_path=BLEEDING_EDGE_PATH,
upload_url=BLEEDING_EDGE_URL,
upload=True,
force_upload_path=False, *args, **kwargs):
PythonModuleBuildRules.__init__(self, upload_path=upload_path,
upload_url=upload_url,
*args, **kwargs)
self.dist_basename = dist_basename
self.force_upload_path = force_upload_path
self.upload = upload
def addCheckoutSteps(self, f):
PythonModuleBuildRules.addCheckoutSteps(self, f)
self.addDevelopSteps(f)
def addBuildSteps(self, f):
f.addStep(ShellCommand,
command=["rm", "-rf", "build", "dist"],
description="removing build directory",
descriptionDone="removed build directory",
usePTY=False,
workdir=self.workdir)
f.addStep(BuildSDist,
workdir=self.workdir,
use_egg_info=self.build_eggs,
env=self.env)
if self.build_eggs:
f.addStep(BuildEgg,
workdir=self.workdir,
env=self.env)
def addEggSteps(self, f):
if self.combination == ("django", "trunk"):
# Use Django SVN, not the egg.
f.addStep(SVN, reponame="django",
svnurl="%s/trunk" % DJANGO_SVN_ROOT,
mode="update",
alwaysUseLatest=True,
workdir="django")
f.addStep(ShellCommand,
command=[self.python, "setup.py", "install"],
description="installing Django SVN",
descriptionDone="installed Django SVN",
workdir="django",
env=self.env,
haltOnFailure=True)
else:
self.egg_deps.append("Django")
f.addStep(ShellCommand,
command=["rm", "-rf",
"lib/%s/site-packages/Djblets*" % self.python],
description="Cleaning up for build",
descriptionDone="Cleaned up for build")
PythonModuleBuildRules.addEggSteps(self, f)
def addDevelopSteps(self, f):
# This will fetch the remaining eggs.
f.addStep(ShellCommand,
command=[self.python, "setup.py", "develop"],
description="Installing in develop mode",
descriptionDone="Installed in develop mode",
env=self.env,
haltOnFailure=True,
workdir=self.workdir)
def addUploadSteps(self, f):
if (self.dist_basename and self.upload and
self.combination == ("django", DJANGO_RELEASE_UPLOAD_VER) and
not self.sandbox):
rotate_patterns = []
if self.pyver == "2.6":
f.addStep(UploadDist,
default_upload_path=self.upload_path,
slavesrc=WithProperties("dist/%(sdist_filename)s"),
dest_filename=WithProperties("%(sdist_filename)s"),
mode=0644,
workdir=self.workdir)
rotate_patterns.append("%s*-py%s.tar.gz" %
(self.dist_basename, self.pyver))
if self.build_eggs:
f.addStep(UploadDist,
default_upload_path=self.upload_path,
slavesrc=WithProperties("dist/%(egg_filename)s"),
dest_filename=WithProperties("%(egg_filename)s"),
mode=0644,
workdir=self.workdir)
rotate_patterns.append("%s*-py%s.egg" %
(self.dist_basename, self.pyver))
f.addStep(RotateFiles,
default_directory=self.upload_path,
patterns=rotate_patterns)
class DjangoEvolutionBuildRules(RBProjectBuildRules):
def __init__(self, *args, **kwargs):
RBProjectBuildRules.__init__(
self,
dist_basename='django_evolution',
egg_deps=[
'setuptools',
'Nose',
'coverage',
'pysqlite',
],
find_links=[MIRROR_URL],
*args, **kwargs)
def addTestSteps(self, f):
f.addStep(NoseTests,
command=[self.python, "tests/runtests.py"],
env=self.env,
workdir=self.workdir,
flunkOnWarnings=True,
haltOnFailure=True)
f.addStep(PyFlakes,
command=[self.python, "./tests/run-pyflakes.py"],
env=self.env,
workdir=self.workdir)
class ReviewBoardBuildRules(RBProjectBuildRules):
def __init__(self, *args, **kwargs):
RBProjectBuildRules.__init__(
self, dist_basename="ReviewBoard",
egg_deps=[
"PIL==1.1.6", # Force our version, for the PIL directory
"coverage",
"mercurial",
"Nose",
"P4PythonInstaller",
"pysqlite",
"django_evolution",
WithProperties("%(djblets_workdir)s/dist/" +
"%(djblets_egg_filename)s"),
],
find_links=[
MIRROR_URL,
],
*args, **kwargs)
def addCheckoutSteps(self, f):
f.addStep(ShellCommand,
command=["../../scripts/build-svn.sh"],
description="installing pysvn",
descriptionDone="installed pysvn",
env=self.env,
haltOnFailure=True)
RBProjectBuildRules.addCheckoutSteps(self, f)
def addDevelopSteps(self, f):
f.addStep(ShellCommand,
command=["rm", "-rf", "settings_local.py"],
description="removing settings_local.py",
descriptionDone="removed settings_local.py",
usePTY=False,
workdir=self.workdir)
# This will fetch the remaining eggs.
RBProjectBuildRules.addDevelopSteps(self, f)
def addTestSteps(self, f):
f.addStep(FileDownload,
mastersrc="scripts/settings_local.py",
slavedest="settings_local.py",
workdir=self.workdir)
f.addStep(ShellCommand,
name="syncdb",
description="syncing database",
descriptionDone="synced database",
command=[self.python, "reviewboard/manage.py",
"syncdb", "--noinput"],
env=self.env,
workdir=self.workdir,
haltOnFailure=True)
f.addStep(ShellCommand,
name="evolve",
description="evolving database",
descriptionDone="evolved database",
command=[self.python, "reviewboard/manage.py", "evolve",
"--execute", "--noinput"],
env=self.env,
workdir=self.workdir,
haltOnFailure=True)
f.addStep(NoseTests,
command=[self.python, "reviewboard/manage.py", "test"],
env=self.env,
workdir=self.workdir,
flunkOnWarnings=True,
haltOnFailure=True)
f.addStep(PyFlakes,
command=[self.python, "contrib/internal/run-pyflakes.py"],
env=self.env,
workdir=self.workdir)
class DjbletsBuildRules(RBProjectBuildRules):
def __init__(self, egg_deps=[], *args, **kwargs):
RBProjectBuildRules.__init__(
self,
dist_basename="Djblets",
egg_deps=[
"setuptools",
"pysqlite",
"django_evolution",
"Nose",
"coverage",
"PIL",
'mock',
] + egg_deps,
find_links=[MIRROR_URL],
*args, **kwargs)
def addTestSteps(self, f):
f.addStep(NoseTests,
command=[self.python, "tests/runtests.py"],
env=self.env,
workdir=self.workdir,
flunkOnWarnings=True,
haltOnFailure=True)
f.addStep(PyFlakes,
command=[self.python, "./tests/run-pyflakes.py"],
env=self.env,
workdir=self.workdir)
class RBToolsBuildRules(PythonModuleBuildRules):
def __init__(self, *args, **kwargs):
PythonModuleBuildRules.__init__(self,
upload_path=BLEEDING_EDGE_PATH,
upload_url=BLEEDING_EDGE_URL,
egg_deps=["setuptools>=0.6c11",
"simplejson"],
find_links=[MIRROR_URL],
*args, **kwargs)
self.dist_basename = "RBTools"
def addUploadSteps(self, f):
if not self.sandbox:
rotate_patterns = []
if self.pyver == "2.6":
f.addStep(UploadDist,
default_upload_path=self.upload_path,
slavesrc=WithProperties("dist/%(sdist_filename)s"),
dest_filename="%(sdist_filename)s",
mode=0644,
workdir=self.workdir)
rotate_patterns.append("%s*-py%s.tar.gz" %
(self.dist_basename, self.pyver))
f.addStep(UploadDist,
default_upload_path=self.upload_path,
slavesrc=WithProperties("dist/%(egg_filename)s"),
dest_filename="%(egg_filename)s",
mode=0644,
workdir=self.workdir)
rotate_patterns.append("%s*-py%s.egg" %
(self.dist_basename, self.pyver))
f.addStep(RotateFiles,
default_directory=self.upload_path,
patterns=rotate_patterns)
def addTestSteps(self, f):
f.addStep(PyFlakes,
command=["pyflakes", "scripts"],
env=self.env,
workdir=self.workdir)
class NightlyBuildRules(BuildRules):
def addCheckoutSteps(self, f):
pass
c['change_source'] = []
c['schedulers'] = []
c['builders'] = []
#
# Review Board build configuration
#
DJANGO_RELEASE_VERS = ["1.3"]
DJANGO_RELEASE_UPLOAD_VER = 'trunk'
rb_build_manager = BuildManager(
slave_info=slave_info,
combinations=[
("django", "trunk"),
] + [
("django", version)
for version in DJANGO_RELEASE_VERS
]
)
rb_build_manager.add([
BuildTarget(
name="rb_nightly",
branches=[
SVNBranch("trunk", ""),
],
triggers=["django"],
wait_for_triggers=True,
nightly=True,
nightly_hour=8,
nightly_stagger_interval=30,
trigger_properties = {
'upload_path': NIGHTLY_PATH,
},
build_rules=NightlyBuildRules()
),
BuildTarget(
name="django",
branches=[
SVNBranch("trunk", "%s/trunk" % DJANGO_SVN_ROOT),
] + [
SVNBranch(version, "%s/tags/releases/%s" %
(DJANGO_SVN_ROOT, version),
poll_frequency=0)
for version in DJANGO_RELEASE_VERS
],
triggers=["django-evolution"],
build_rules=BuildRules()
),
BuildTarget(
name="django-evolution",
branches=[
SVNBranch("trunk",
"http://django-evolution.googlecode.com/svn/trunk",
poll_frequency=60*100),
],
dependencies=["django"],
triggers=["djblets", "djblets-0.6"],
trigger_excludes=TRIGGER_EXCLUDES,
build_rules=DjangoEvolutionBuildRules()
),
BuildTarget(
name="djblets",
branches=[
GitBranch("master", "master",
"git://github.com/djblets/djblets.git"),
],
dependencies=["django"],
allow_sandbox=True,
triggers=["reviewboard"],
trigger_excludes=TRIGGER_EXCLUDES,
trigger_properties={
'djblets_egg_filename': WithProperties("%(egg_filename)s"),
},
build_rules=DjbletsBuildRules(egg_deps=[
'django-pipeline',
])
),
BuildTarget(
name="djblets-0.6",
branches=[
GitBranch("release-0.6.x", "0.6.x",
"git://github.com/djblets/djblets.git"),
],
dependencies=["django"],
allow_sandbox=True,
triggers=["reviewboard-1.6"],
trigger_excludes=TRIGGER_EXCLUDES + [
'triggered_reviewboard-1.6_django_trunk_py2.4',
'triggered_reviewboard-1.6_django_trunk_py2.5',
'triggered_reviewboard-1.6_django_trunk_py2.6',
],
trigger_properties={
'djblets_egg_filename': WithProperties("%(egg_filename)s"),
'djblets_workdir': WithProperties("%(djblets-0.6_workdir)s"),
},
build_rules=DjbletsBuildRules(egg_deps=[
'django-pipeline==1.1.27'
])
),
BuildTarget(
name="reviewboard",
branches=[
GitBranch("master", "master",
"git://github.com/reviewboard/reviewboard.git"),
],
exclude_from=[('django', '1.3')],
dependencies=["django", "django-evolution", "djblets"],
allow_sandbox=True,
build_rules=ReviewBoardBuildRules()
),
BuildTarget(
name="reviewboard-1.6",
branches=[
GitBranch("release-1.6.x", "1.6.x",
"git://github.com/reviewboard/reviewboard.git"),
],
dependencies=["django", "django-evolution", "djblets"],
allow_sandbox=True,
build_rules=ReviewBoardBuildRules(upload=False)
),
])
c['change_source'] += rb_build_manager.get_pollers()
c['schedulers'] += rb_build_manager.get_schedulers(exclude=RB_EXCLUDES)
c['builders'] += rb_build_manager.get_builders(exclude=RB_EXCLUDES)
#
# RBTools build configuration
#
rbtools_build_manager = BuildManager(
slave_info=slave_info,
combinations=[
("rbtools", "master"),
]
)
rbtools_build_manager.add([
BuildTarget(
name="rbtools_nightly",
branches=[
GitBranch("master", "master", ""),
],
triggers=["rbtools"],
wait_for_triggers=True,
nightly=True,
nightly_hour=8,
trigger_properties = {
'upload_path': NIGHTLY_PATH,
},
build_rules=NightlyBuildRules()
),
BuildTarget(
name="rbtools",
branches=[
GitBranch("master", "master",
"git://github.com/reviewboard/rbtools.git"),
],
allow_sandbox=True,
build_rules=RBToolsBuildRules()
),
])
c['change_source'] += rbtools_build_manager.get_pollers()
c['schedulers'] += rbtools_build_manager.get_schedulers()
c['builders'] += rbtools_build_manager.get_builders()
#
# Review Board docs build configuration
#
c['schedulers'].append(Nightly(name='nightly_docs',
builderNames=['rbdocs'],
hour=10,
branch="master",
minute=0))
f = factory.BuildFactory()
f.addStep(ShellCommand(
command=['%s/scripts/update-docs.py' % RB_WEBSITE_DIR],
description="Generating website docs",
descriptionDone="Generated website docs"))
c['builders'].append({
'name': 'rbdocs',
'slavename': 'rbwebsite',
'factory': f,
'category': 'builds',
'builddir': 'rbdocs',
})
####### STATUS TARGETS
# 'status' is a list of Status Targets. The results of each build will be
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
# including web pages, email senders, and IRC bots.
from buildbot.status import html, mail
c['status'] = [
# Public
html.WebStatus(http_port="tcp:12344:interface=127.0.0.1",
public_html=PUBLIC_HTML_DIR,
allowForce=False),
# Private
html.WebStatus(http_port="tcp:12345:interface=127.0.0.1",
public_html=PUBLIC_HTML_DIR,
allowForce=True),
# E-mail notifications
mail.MailNotifier(fromaddr="[email protected]",
mode="problem",
extraRecipients=c['administrators'],
relayhost="localhost",
sendToInterestedUsers=False),
# IRC
words.IRC("irc.freenode.net", "RB-BuildBot",
channels=["#reviewboard-students"],
notify_events={
'exception': 1,
'successToFailure': 1,
'failureToSuccess': 1,
}),
]
#from buildbot.status import words
#c['status'].append(words.IRC(host="irc.freenode.net", nick="<NICK>",
# password="<PASSWORD>",
# channels=["<CHANNEL>"]))
# from buildbot.status import client
# c['status'].append(client.PBListener(9988))
####### DEBUGGING OPTIONS
# if you set 'debugPassword', then you can connect to the buildmaster with
# the diagnostic tool in contrib/debugclient.py . From this tool, you can
# manually force builds and inject changes, which may be useful for testing
# your buildmaster without actually commiting changes to your repository (or
# before you have a functioning 'sources' set up). The debug tool uses the
# same port number as the slaves do: 'slavePortnum'.
#c['debugPassword'] = "debugpassword"
# if you set 'manhole', you can ssh into the buildmaster and get an
# interactive python shell, which may be useful for debugging buildbot
# internals. It is probably only useful for buildbot developers. You can also
# use an authorized_keys file, or plain telnet.
#from buildbot import manhole
#c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1",
# "admin", "password")
####### PROJECT IDENTITY
# the 'projectName' string will be used to describe the project that this
# buildbot is working on. For example, it is used as the title of the
# waterfall HTML page. The 'projectURL' string will be used to provide a link
# from buildbot HTML pages to your project's home page.
c['projectName'] = "Review Board"
c['projectURL'] = "http://www.reviewboard.org/"
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server (usually the html.Waterfall page) is visible. This
# typically uses the port number set in the Waterfall 'status' entry, but
# with an externally-visible host name which the buildbot cannot figure out
# without some help.
c['buildbotURL'] = "http://build.reviewboard.org/"
# vim: set ft=python: