[Buildbot-devel] How to modify an existing factory?

Axel Hecht l10n.moz at googlemail.com
Sat Dec 13 00:04:35 UTC 2008

Another thing you could do is to set the differing properties as build
properties in your schedulers, and use WithProperties in the steps.


2008/12/12 Mark MacVicar <mark.macvicar at gmail.com>

> Hi all,
> I was wondering if anyone knew of an easy way to modify an existing
> factory, or step instance?
> I have several factories that are just slightly different from one
> another (e.g., one is a "release" factory, another is a "debug"
> factory, another builds a special branch, etc...). I also tend to have
> a lot of steps in a factory (I find it helpful). Rather than copy
> pasting the steps and making a minor edit, I was hoping there would be
> a way I could tweak step/factory creation.
> At first I was thinking that what I could do was create a list of all
> the steps, and then modify the list, but then I realized the list is
> filled with step instances and not strings, which makes it a little
> trickier if I want to search and replace a string in that list.
> For example:
> -------------------
> releaseLinux32_workdir = 'foo'
> branchLinux32_workdir = 'bar'
> linux_release_steps = [
> # Clean all files
>        ShellCommand(
>                workdir=releaseLinux32_workdir,
>                name='Cleaning All Targets',
>                description='Cleaning All Targets',
>                descriptionDone='Cleaned All Targets',
>                env={'ENV_VAR' : 'releaseLinux32_workdir'}
>                command=['clean'])]
> # I want to use all the same steps in linux_release_steps,
> # but change the references to releaseLinux32_workdir to
> branchLinux32_workdir
> # I might also want to change other settings.
> #linux_branch_steps =
> linux_release_steps.replace('releaseLinux32_workdir',
> 'branchLinux32_workdir')
> --------------------
> I guess what I really want is a macro, and am not sure how to go about
> that in python. Does anyone have a different solution?
> Thanks,
> Mark MacVicar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20081213/b088b45c/attachment.html>

More information about the devel mailing list