[Buildbot-devel] running master side steps?

Brian Warner warner-buildbot at lothar.com
Wed Nov 21 21:54:07 UTC 2007


> I would like to have the master perform some tasks as part of some
> builders. Is there an easy way I can add steps to execute my own python
> code master side?

Yeah, if you subclass buildbot.process.buildstep.BuildStep directly, and
override the start() method, you can put whatever code you want into that
step, and it will run on the master side. The docstring of start() explains
how the method should work and what your code needs to do.

The implementation of that method is not ideal yet.. at some point I plan to
change it to just return a Deferred like everything else does (instead of
requiring that you call a .finished or .failed method yourself). But it isn't
super hard to get right in its present form. Just keep your eyes open for
later releases that modify this behavior, so you can adapt your code to match
in the future.

Having the master-side code run shell commands is slightly more effort,
you'll probably need to use twisted.internet.util.getProcessOutput() and
handle the Deferred it returns properly. Also, if you want your code to
create logfiles and participate in the usual status-reporting stuff, you
might want to subclass LoggingBuildStep instead of the plain BuildStep. There
are more assumptions built in to LoggingBuildStep, though.. this code isn't
factored very well right now.

cheers,
 -Brian




More information about the devel mailing list