This repository has been archived by the owner on Mar 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
master.cfg
147 lines (123 loc) · 4.7 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
# -*- python -*-
# ex: set syntax=python:
import buildbotcustom.changes.hgpoller
reload(buildbotcustom.changes.hgpoller)
from buildbot.buildslave import BuildSlave
from buildbot.status import html, mail
from buildbot.status.web import auth, authz
from buildbot.changes.pb import PBChangeSource
from buildbot.scheduler import Scheduler
from buildbot.schedulers.timed import Nightly, Periodic
from buildbotcustom.changes.hgpoller import HgPoller
from buildbot.config import BuilderConfig
import preproduction_factory
import release_master
import release_config
reload(preproduction_factory)
reload(release_master)
reload(release_config)
from preproduction_factory import PPBuildFactory
from release_master import PPReleaseFactory
from release_config import rmConfig
config = {}
# TODO: move vars to config.py
# TODO: move steps to class
# TODO: diff pre and production configs, compare with master copy
HG_HOST = 'hg.mozilla.org'
repos = {'build/buildbot': 'default',
'build/buildbotcustom': 'default',
'build/buildbot-configs': 'default',
'build/tools': 'default'}
master_dirs = ('scheduler-master', 'builder-master', 'tests-scheduler-master',
'tests-master')
buildbot_wrangler = '../tools/buildfarm/maintenance/buildbot-wrangler.py'
c = BuildmasterConfig = {}
c['projectName'] = "Mozilla"
c['projectURL'] = "http://www.mozilla.org"
c['buildbotURL'] = "http://preproduction-master.build.mozilla.org:8710/"
c['db_url'] = "sqlite:///state.sqlite"
c['slavePortnum'] = 9710
c['slaves'] = [BuildSlave("myself", "passwd")]
c['change_source'] = []
c['mergeRequests'] = lambda b, r1, r2: False
c['change_source'].append(PBChangeSource())
for repo in repos.keys():
c['change_source'].append(HgPoller(
hgURL='http://%s/' % HG_HOST,
branch=repo,
tipsOnly=1,
pollInterval=10*60
))
####### SCHEDULERS
## configure the Schedulers
c['schedulers'] = []
c['schedulers'].append(Scheduler(name="all",
treeStableTimer=None,
builderNames=["test-masters"]))
c['schedulers'].append(Nightly(name='weekly',
dayOfWeek=0,
hour=[1],
builderNames=['setup-masters']))
c['schedulers'].append(Periodic(name='releases',
periodicBuildTimer=3*24*60*60, # every 3 days
builderNames=['release-master']))
####### BUILDERS
f = PPBuildFactory(HG_HOST)
for repo, branch in repos.iteritems():
f.update_repo(repo, branch)
f.setup_virtualenv()
f.test_masters()
f.bbc_pylint()
f.tools_pylint()
f.tools_run_tests()
f.bbc_run_tests()
f.config_tests()
for project in ('buildbotcustom',):
f.coverage(project)
for r in ('buildbotcustom/buildbotcustom', 'buildbot-configs', 'tools'):
f.run_on_master('/builds/buildbot/%s' % r, 'hg pull -u')
for d in master_dirs:
f.run_on_master('/builds/buildbot/%s' % d,
'%s reconfig /builds/buildbot/%s' % (buildbot_wrangler, d))
test_masters_builder = BuilderConfig(name='test-masters',
slavename='myself',
builddir='test-masters',
factory=f)
w = PPBuildFactory(HG_HOST)
for d in master_dirs:
w.run_on_master('/builds/buildbot/%s' % d,
'%s stop /builds/buildbot/%s' % (buildbot_wrangler, d))
w.setup_virtualenv(workdir='/builds/buildbot/%s/sandbox' % d)
w.run_on_master('/builds/buildbot/preproduction', './db-cleanup.py')
for d in master_dirs:
w.run_on_master('/builds/buildbot/%s' % d,
'%s start /builds/buildbot/%s' % (buildbot_wrangler, d))
setup_masters = {'name': 'setup-masters',
'slavename': 'myself',
'builddir': 'setup-masters',
'factory': w,
}
release_factory = PPReleaseFactory(rmConfig=rmConfig)
release_master = {'name': 'release-master',
'slavename': 'myself',
'builddir': 'release_master',
'factory': release_factory,
}
c['builders'] = [test_masters_builder, setup_masters, release_master]
c['status'] = []
authz_cfg=authz.Authz(
gracefulShutdown = True,
forceBuild = True,
forceAllBuilds = True,
pingBuilder = True,
stopBuild = True,
stopAllBuilds = True,
cancelPendingBuild = True,
)
c['status'].append(html.WebStatus(http_port=8710, authz=authz_cfg))
c['status'].append(
mail.MailNotifier(fromaddr="cltbld@preproduction-master.build.mozilla.org",
extraRecipients=["release@mozilla.com"],
sendToInterestedUsers=False,
mode='change',
))