Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
143 lines (118 sloc) 4.43 KB
# -*- 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')
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()
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, 'make reconfig')
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, 'make stop')
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, 'make start')
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',
))
Jump to Line
Something went wrong with that request. Please try again.