blob: fe0571bbd18ae790ce272c1afafb56dff16c0319 [file] [log] [blame]
# -*- python -*-
# ex: set syntax=python:
from importlib import reload
# Extend paths to allow loading zorg and config modules.
import os, sys
# All the configuration files are under the directory
# where master.cfg file is.
cfg_path = os.path.abspath(os.path.dirname(__file__))
if cfg_path not in sys.path:
sys.path.append(cfg_path)
# Zorg is 3 levels up.
path = os.path.abspath(
os.path.join(cfg_path, '..', '..', '..')
)
if path not in sys.path:
sys.path.append(path)
##print(">>> sys.path={}}".format(sys.path)) # TODO: Remove this later.
# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {}
c['buildbotNetUsageData'] = None
import config
reload(config)
####### Workers
c['workers'] = config.workers.get_all()
c['protocols'] = {'pb': {'port': 9990}}
####### CHANGESOURCES
##from buildbot.changes.pb import PBChangeSource
from zorg.buildbot.changes.llvmgitpoller import LLVMPoller
from zorg.buildbot.process.buildrequest import collapseRequests
c['change_source'] = []
# TODO: Do we want to support a push mode for the changes? Probably not.
#c['change_source'].append(PBChangeSource())
c['change_source'].append(
LLVMPoller(repourl='https://github.com/llvm/llvm-project.git',
workdir='gitpoller-workdir',
pollinterval=120))
c['collapseRequests'] = collapseRequests
####### BUILDERS
from buildbot.plugins import util
c['builders'] = builders = [
util.BuilderConfig(**b) for b in config.builders.all
]
####### SCHEDULERS
c['schedulers'] = config.schedulers.getSingleBranchSchedulers(
c['builders'])
c['schedulers'].extend(config.schedulers.getForceSchedulers(
c['builders']))
####### 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.
# Configure MailNotifier, IRC, buildbot.reporters.github.GitHubStatusPush, buildbot.reporters.github.GitHubCommentPush
c['services'] = config.status.getReporters()
####### PROJECT IDENTITY
c['title'] = config.options.get('Buildbot', 'title')
c['titleURL'] = config.options.get('Buildbot', 'title_url')
c['buildbotURL'] = config.options.get('Buildbot', 'my_url')
# minimalistic config to activate new web UI
c['www'] = dict(port=8011,
plugins=dict(waterfall_view={}, console_view={}, grid_view={}), # TODO: badges
default_page='console',
auth=config.auth.getAuth(),
authz=config.auth.getAuthz(),
#logRotateLength=
#maxRotatedFiles=
#versions=
)
####### DB URL
c['db'] = {
'db_url' : config.options.get('Database', 'db_url'),
}
####### RESOURCE USAGE
from datetime import timedelta
# TODO: Figure out the "changeHorizon" value for our usage.
#c["changeHorizon"] = 300
# configure a janitor which will delete all logs older than one month,
# and will run on sundays at noon
# TODO: Recheck the setting for the production bot.
c['configurators'] = [util.JanitorConfigurator(
logHorizon=timedelta(weeks=4), # Roughly once a month.
hour=12,
dayOfWeek=6
)]