[Buildbot-devel] sharing buildsteps
Brian Warner
warner-buildbot at lothar.com
Wed Nov 21 21:45:57 UTC 2007
> Yes, I can see how this works (and in fact that is how I have done it
> myself). However, I wonder whether it wouldn't be possible to cover the
> same functionality with a more declarative syntax (given that we are
> talking about a configuration file).
>
> Brian, I know you had plans to implement a 'clone' method for steps.
> As the BuildFactories already are sharable, I wonder what's missing to
> make individual steps sharable, too. It's just a different granularity...
Hmm, the following code would take a BuildStep and give you a new copy:
f,args = oldstep.getStepFactory
newstep = f(**args)
But since the original steps are just being used as templates to create new
ones, if you don't need to modify the steps (just re-use them), you should be
able to do the following safely:
checkout = Darcs(repo, stuff)
test = ShellCommand(stuff)
package = ShellCommand(otherstuff)
f1 = BuildFactory()
f1.addStep(checkout)
f1.addStep(test)
f2 = BuildFactory()
f2.addStep(checkout)
f2.addStep(test)
f2.addStep(package)
Is that the kind of functionality you're talking about?
cheers,
-Brian
More information about the devel
mailing list