Skip to content

Commit

Permalink
update sample for master.cfg to use plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Sobolev committed Jan 13, 2015
1 parent b9da30e commit 4f0ecdb
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions master/buildbot/scripts/sample.cfg
@@ -1,6 +1,8 @@
# -*- python -*-
# ex: set syntax=python:

from buildbot.plugins import *

# This is a sample buildmaster config file. It must be installed as
# 'master.cfg' in your buildmaster's base directory.

Expand All @@ -13,8 +15,7 @@ c = BuildmasterConfig = {}
# 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")]
c['slaves'] = [buildslave.BuildSlave("example-slave", "pass")]

# 'protocols' contains information about protocols which master will use for
# communicating with slaves.
Expand All @@ -29,9 +30,8 @@ c['protocols'] = {'pb': {'port': 9989}}
# 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.gitpoller import GitPoller
c['change_source'] = []
c['change_source'].append(GitPoller(
c['change_source'].append(changes.GitPoller(
'git://github.com/buildbot/pyflakes.git',
workdir='gitpoller-workdir', branch='master',
pollinterval=300))
Expand All @@ -41,16 +41,13 @@ c['change_source'].append(GitPoller(
# 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(
c['schedulers'].append(schedulers.SingleBranchScheduler(
name="all",
change_filter=filter.ChangeFilter(branch='master'),
change_filter=util.ChangeFilter(branch='master'),
treeStableTimer=None,
builderNames=["runtests"]))
c['schedulers'].append(ForceScheduler(
c['schedulers'].append(schedulers.ForceScheduler(
name="force",
builderNames=["runtests"]))

Expand All @@ -60,21 +57,15 @@ c['schedulers'].append(ForceScheduler(
# 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.source.git import Git
from buildbot.steps.shell import ShellCommand

factory = BuildFactory()
factory = util.BuildFactory()
# check out the source
factory.addStep(Git(repourl='git://github.com/buildbot/pyflakes.git', mode='incremental'))
factory.addStep(steps.Git(repourl='git://github.com/buildbot/pyflakes.git', mode='incremental'))
# run the tests (note that this will require that 'trial' is installed)
factory.addStep(ShellCommand(command=["trial", "pyflakes"]))

from buildbot.config import BuilderConfig
factory.addStep(steps.ShellCommand(command=["trial", "pyflakes"]))

c['builders'] = []
c['builders'].append(
BuilderConfig(name="runtests",
util.BuilderConfig(name="runtests",
slavenames=["example-slave"],
factory=factory))

Expand Down

0 comments on commit 4f0ecdb

Please sign in to comment.