From 18dba377562b56e44dea00fcd2307f1a510f9de5 Mon Sep 17 00:00:00 2001 From: Will Holland Date: Fri, 4 Sep 2015 17:05:50 +0100 Subject: Initial Commit Basic buildbot logic to run firehose, a builder and a tester upon receiving various triggers --- source/master.cfg | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 source/master.cfg (limited to 'source/master.cfg') diff --git a/source/master.cfg b/source/master.cfg new file mode 100644 index 0000000..c2713ef --- /dev/null +++ b/source/master.cfg @@ -0,0 +1,156 @@ +# -*- python -*- +# ex: set syntax=python: + +# This is a sample buildmaster config file. It must be installed as +# 'master.cfg' in your buildmaster's base directory. + +# 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'] = [BuildSlave("example-slave", "pass")] + +# 'protocols' contains information about protocols which master will use for +# communicating with slaves. +# You must define at least 'port' option that slaves could connect to your master +# with this protocol. +# 'port' must match the value configured into the buildslaves (with their +# --master option) +c['protocols'] = {'pb': {'port': 9989}} + +####### 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 buildbot.changes.pb import PBChangeSource +# interface for incoming triggers +c['change_source'] = [] +c['change_source'].append(PBChangeSource( + port=9999, + user='orchestration', + passwd='orchestration')) + +from buildbot.changes.filter import ChangeFilter + +definitions_filter = ChangeFilter(category='definitions') +lorry_filter = ChangeFilter(category='lorry') +postbuild_filter = ChangeFilter(category='postbuild') + +####### 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="trigger_builders_sched", + change_filter=definitions_filter, + treeStableTimer=None, + builderNames=["trigger_builders"])) +c['schedulers'].append(SingleBranchScheduler( + name="trigger_firehose_sched", + change_filter=lorry_filter, + treeStableTimer=None, + builderNames=["trigger_firehose"])) +c['schedulers'].append(SingleBranchScheduler( + name="trigger_testing_sched", + change_filter=postbuild_filter, + treeStableTimer=None, + builderNames=["trigger_testing"])) + +####### 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.steps.shell import ShellCommand + +builders_factory = BuildFactory() +# run the tests (note that this will require that 'trial' is installed) +builders_factory.addStep(ShellCommand(command=["sh","../../../source/builders_trigger.sh"])) + +firehose_factory = BuildFactory() +# run the tests (note that this will require that 'trial' is installed) +firehose_factory.addStep(ShellCommand(command=["sh","../../../source/firehose_trigger.sh"])) + +testing_factory = BuildFactory() +# run the tests (note that this will require that 'trial' is installed) +testing_factory.addStep(ShellCommand(command=["sh","../../../source/testing_trigger.sh"])) + +from buildbot.config import BuilderConfig + +c['builders'] = [] +c['builders'].append( + BuilderConfig(name="trigger_builders", + slavenames=["example-slave"], + factory=builders_factory)) +c['builders'].append( + BuilderConfig(name="trigger_firehose", + slavenames=["example-slave"], + factory=firehose_factory)) +c['builders'].append( + BuilderConfig(name="trigger_testing", + slavenames=["example-slave"], + factory=firehose_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'] = [] + +from buildbot.status import html +from buildbot.status.web import authz, auth + +authz_cfg=authz.Authz( + # change any of these to True to enable; see the manual for more + # options + auth=auth.BasicAuth([("codething","password")]), + gracefulShutdown = False, + forceBuild = 'auth', # use this to test your slave once it is set up + forceAllBuilds = False, + pingBuilder = False, + stopBuild = False, + stopAllBuilds = False, + cancelPendingBuild = False, +) +c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg)) + +####### 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'] = "CIAT" +c['titleURL'] = "https://wiki.baserock.org" + +# 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'] = "http://localhost:8010/" + +####### 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", +} -- cgit v1.2.1