[Buildbot-devel] Can't make schedulers trigger a build

Brian Warner warner-buildbot at lothar.com
Thu Nov 24 20:00:10 UTC 2005

> On a svn commit, no action is triggered, even when i setup a very low 
> delay as a timer.

> c['sources'].append(PBChangeSource(prefix=""))

The PBChangeSource sets up a listener.. now you need to set up a sender.

You'll want to use the contrib/svn_buildbot.py script, run as an SVN
'post-commit' hook by editing the 'hooks/post-commit' file in your SVN

Basically you add the hook so that every time you make an SVN commit,
svn_buildbot.py gets run. svn_buildbot.py makes a TCP connection to the
buildmaster's PBChangeSource and tells it about the Change.

The comments in contrib/svn_buildbot.py have a good description of how to
modify the post-commit script. Also, you can run 'buildbot sendchange' to
test that your PBChangeSource is listening and accessible.. it uses the same
TCP-connection scheme as svn_buildbot.py, just with different arguments.
Eventually I'd like to fold svn_buildbot.py into a mode of sendchange, so you
could put something like 'buildbot sendchange --svn' in your post-commit, but
I haven't yet looked into the feasibility of that.

> One more thing though : i had to modify buildbot a bit to give the svn 
> user and password with --username and --password command line switches 
> instead than in the URL.

Interesting! How are these passed into the 'svn' command? If you think this
functionality would be useful to others, would you be willing to contribute a

> onchange_sched = Scheduler(name="onchange", branch=None,
>                            treeStableTimer=10,

FYI, when a Change is received, you'll see a link in the left-hand "Changes"
column on the Waterfall display, so a short treeStableTimer isn't strictly
necessary to debug whether Changes are being received or not.

> periodic_sched = Periodic(name="periodic", builderNames=['openwengo-ubuntu-x86-full', 'openwengo-macosx-ppc-full'],
>                           periodicBuildTimer=10)

Remember that periodicBuildTimer is in seconds. If your build takes more than
10 seconds to run, this Periodic scheduler will be running builds constantly.

>         s(step.ShellCommand, env={"PATH" : os.environ['PATH'] + ":/sw/bin:/sw/sbin:/usr/local/Trolltech/Qt-4.0.1/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/opt/local/bin:/sw/bin:/sw/sbin:/usr/local/Trolltech/Qt-4.0.1/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/opt//local/Library/Frameworks/Python.framework/Versions/2.4/bin:/System/Library/Frameworks/Python.framework/Versions/2.3/bin:/usr/local/bin:/sw/include/glib-2.0"}, command=["scons", "-f", "SConstruct.ng", "phapiwrapper=1", "enable-video=0", "qtwengophone-ng"]),

Remember that this 'os.environ' reference is being evaluated on the
buildmaster, while the PATH being set will be used on the buildslaves. On my
own buildbots, I've occasionally found it useful to start the buildslave in
an environment with project-specific PATH settings already present. I usually
add PATH=foo directives into the 'Makefile.buildbot' file for this.
(basically I don't assume that all buildslaves will have the same
requirements or local directories, so I think of that stuff as part of the
buildslave's configuration rather than the project's configuration).

hope that helps,

More information about the devel mailing list