[Buildbot-devel] Configurable clobber build
Vasily
vassnlit at gmail.com
Tue May 6 15:56:30 UTC 2014
Hi,
Property() itself does nothing, it needs to be evaluated by something.
In doStepIf callback there is nothing that can evaluate it, compared to
normal usage when you assign Property() to some argument of a step like
"command". So your working approach seems the correct one to me.
Also maybe you can subclass Git step and make it check this property in its
execution phase.
Thanks,
Vasily
06.05.2014 18:33 пользователь "Martijn van Oosterhout" <kleptog at gmail.com>
написал:
> 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/
>
>
> ------------------------------------------------------------------------------
> Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> 3 signs your SCM is hindering your productivity
> Requirements for releasing software faster
> Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20140506/d7a73207/attachment.html>
More information about the devel
mailing list