[Buildbot-devel] Configurable clobber build

Martijn van Oosterhout kleptog at gmail.com
Tue May 6 14:33:13 UTC 2014


Hoi,

I would like to be able to configure whether the checkout should clobber on
a per build basis. Basically to do normal builds during the day and a
clobber build at night and on demand.

Triggering is the easy part:

c['schedulers'].append(
    timed.Nightly(name='nightly',
        branch='master',
        builderNames=['builder'],
        hour=3,
        minute=0,
        properties={'clobber': True}))

c['schedulers'].append(ForceScheduler(
                            name="force",
                            repository=FixedParameter(name="repository",
default=""),
                            project=FixedParameter(name="project",
default=""),
                            properties=[BooleanParameter(name="clobber",
label="Clobber Build", default=False)],
                            builderNames=["builder"]))

But actually making it work is another. I tried this:

factory.addStep(ShellCommand(name="clobber",
                             command=["rm -rf ."],
                             description=["clobber"],
                             doStepIf=lambda x: Property('clobber',
default=False)))

But the step is executing anyway. I don't think the parameter is evaluation
properly. I tried this:

factory.addStep(Git(repourl="ssh://git.mssdev.fox.local:29418/plato.git",
mode=Property('checkout_mode', 'update', defaultWhenFalse=False)))

But a property is not allowed in this context. Something using Interpolate
would be better, but that doesn't work either.

What does work is this:

factory.addStep(ShellCommand(name="clobber",
                             command="rm -rf -- * .git",
                             description=["clobber"],
                             doStepIf=lambda step:
step.build.getProperty('clobber', default=False)))

But it seems to me that using Property should work in the above situations.
Am I missing something?

Version: 0.8.7p1

Thanks in advance,
-- 
Martijn van Oosterhout <kleptog at gmail.com> http://svana.org/kleptog/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20140506/33c01dda/attachment.html>


More information about the devel mailing list