[Buildbot-devel] Create collection of build steps
Mark Pauley
mpauley at apple.com
Fri Sep 29 17:31:46 UTC 2006
Notice that you're passing one argument (a step) to addStep in the
case where it doesn't work, but several to addStep when it does work.
maybe what you want to do is
f1.steps.append(commonSteps["make"])
f1.steps.append(commonSteps["compile"])
or (since the s method just creates a 2-tuple)
f1.addStep(commonSteps["make"][0], commonSteps["make"][1])
etc.
either way seems a bit hacky to me, as they violate encapsulation..
perhaps the buildfactory needs to respond to either the append or
appendStep method?
_Mark
On Sep 28, 2006, at 3:30 PM, Mateusz Loskot wrote:
> Hi,
>
> I'd like to create collection of common steps used by number of build
> factories. Here is how I'm trying to do it:
>
> s = factory.s
>
> commonSteps = {}
>
> commonSteps["cvs"] = s(step.CVS,
> name="cvs",
> cvsroot = myRoot,
> cvsmodule = myModule,
> mode="update")
>
> commonSteps["make"] = s(step.ShellCommand,
> name="make",
> description=["compiling"],
> descriptionDone=["compile"],
> command=["make"])
>
> Next, I'm adding these steps in appropriate order to different
> factories:
>
> f1 = factory.BuildFactory
> f1.addStep(commonSteps["cvs"])
> f1.addStep(commonSteps["make"])
> ...
>
> f2 = factory.BuildFactory
> f2.addStep(commonSteps["cvs"])
> f2.addStep(commonSteps["make"])
> ...
>
> When I launch build (Force Build) I get following error (pasted
> important part):
>
> error while creating step, factory=(<class buildbot.process.step.CVS
> ...
>
> and
>
> ...
> File
> "/buildbot/usr/lib/python2.4/site-packages/buildbot/process/base.py",
> line 359, in setupBuild
> step = factory(build=self, **args)
> exceptions.TypeError: 'tuple' object is not callable
>
>
> But if I add build step directly, everything works well:
>
> f1.addStep(step.CVS,
> name="cvs",
> cvsroot = myRoot,
> cvsmodule = myModule,
> mode="update")
>
>
> I don't understand where is the difference. As I understand,
> in examples factory.s() function should return appropriate structure.
>
> Could anyone explain me how to gain collection of re-usable build
> steps?
>
> Cheers
> --
> Mateusz Loskot
> http://mateusz.loskot.net
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to
> share your
> opinions on IT & business topics through brief surveys -- and earn
> cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
More information about the devel
mailing list