blob: b44bcd59fe626b1154c74b54015263daa981e55f [file] [log] [blame]
# -*- python -*-
# This is Melange's buildmaster config file. It must be installed as
# 'master.cfg' in the buildmaster's base directory.
import private
import extensions
import message_notifier
# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {}
####### BUILDSLAVES
# The 'slaves' list defines the set of recognized buildslaves. Each element is
# a BuildSlave object, specifying a unique slave name and password. The same
# slave name and password must be configured on the slave.
from buildbot.buildslave import BuildSlave
c['slaves'] = []
c['slaves'].append(BuildSlave(
'example-slave', private.slave_password,
notify_on_missing=private.ml_address))
c['slaves'].append(BuildSlave(
'slave2', private.slave_password,
notify_on_missing=private.ml_address))
c['slaves'].append(BuildSlave(
'slave3', private.slave_password,
notify_on_missing=private.ml_address))
# 'slavePortnum' defines the TCP port to listen on for connections from slaves.
# This must match the value configured into the buildslaves (with their
# --master option)
c['slavePortnum'] = private.slavePortnum
####### CHANGESOURCES
# the 'change_source' setting tells the buildmaster how it should find out
# about source code changes. Here we point to the buildbot clone of pyflakes.
from gitpoller import GerritGitPoller
c['change_source'] = []
c['change_source'].append(
GerritGitPoller(
repourl='https://melange.googlesource.com/soc',
branches=True,
pollAtLaunch=False,
pollInterval=300))
####### SCHEDULERS
# Configure the Schedulers, which decide how to react to incoming
# changes. In this case, just kick off a 'runtests' build
from buildbot.schedulers.basic import SingleBranchScheduler
from buildbot.schedulers.forcesched import ForceScheduler
from buildbot.changes import filter
c['schedulers'] = []
c['schedulers'].append(SingleBranchScheduler(
name='all',
change_filter=filter.ChangeFilter(branch_re='.*'),
treeStableTimer=None,
builderNames=['runtests'],
fileIsImportant=extensions.isImportant
))
c['schedulers'].append(ForceScheduler(
name='force',
builderNames=['runtests'],
))
####### BUILDERS
# The 'builders' list defines the Builders, which tell Buildbot how to
# perform a build: what steps, and which slaves can execute them.
# Note that any particular build will only take place on one slave.
from buildbot.process.factory import BuildFactory
from buildbot.config import BuilderConfig
factory = BuildFactory()
factory = extensions.populateBuildFactory(factory)
c['builders'] = []
c['builders'].append(BuilderConfig(
name='runtests',
slavenames=['example-slave', 'slave2', 'slave3'],
factory=factory))
####### 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.
c['status'] = []
import gerrit
from buildbot.status import html
from buildbot.status.web import authz
from buildbot.status.web import auth
from buildbot.status.mail import MailNotifier
mail_notifier = MailNotifier(
fromaddr=private.buildbot_email,
sendToInterestedUsers=True,
extraRecipients=[private.ml_address],
lookup=extensions.UsersAreEmails(),
messageFormatter=message_notifier.html_message_formatter)
c['status'].append(mail_notifier)
authz_cfg = authz.Authz(
# update with: htpasswd -d htpasswd <username>
auth=auth.HTPasswdAuth("htpasswd"),
# change any of these to True to enable; see the manual for more
# options
forceBuild='auth',
forceAllBuilds=False,
pingBuilder=False,
stopBuild='auth',
cancelPendingBuild='auth',
stopAllBuilds='auth',
)
c['status'].append(html.WebStatus(http_port=8020, authz=authz_cfg))
c['status'].append(gerrit.GerritStatusPush())
######## IRC TARGETS
# from irc import ExtendedIRC
# irc = ExtendedIRC('irc.freenode.net', 'buildbot',
# channels=['melange'],
# allowForce=True,
# notify_events={
# 'exception': 1,
# 'successToFailure': 1,
# 'failureToSuccess': 1,
# }
# )
# c['status'].append(irc)
####### PROJECT IDENTITY
# the 'title' string will appear at the top of this buildbot
# installation's html.WebStatus home page (linked to the
# 'titleURL') and is embedded in the title of the waterfall HTML page.
c['title'] = 'Melange'
c['titleURL'] = 'https://melange.googlesource.com/soc/'
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server (usually the html.WebStatus 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'] = private.buildbot_url
####### 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',
}