[Buildbot-devel] Condition a step according to a WithProperties value

Axel Hecht l10n.moz at googlemail.com
Tue Mar 15 16:54:39 UTC 2011


At some point on 0.7, WithProperties got fallback values for missing
properties, see
https://github.com/buildbot/buildbot/commit/b463a9e44f1cb0cbea1d7d9dd2c0b4be779e7010.
No idea which release this is, but it's in 0.7.12 (which may or may not be
easier to migrate to)

You could use that to specify a default revision to use instead of the
specific one.

Axel

2011/3/15 Benoît Allard <benoit at aeteurope.nl>

>
>
> Alex wrote:
>
>> Benoit,
>>
>> thanks for your help, it is very nice.
>> Maybe my question is stupid but, are the branch and revision variables
>> really exists ?
>>
>
> No, they don't exists, hence my hint about the two parameters of your
> custom step. If I elaborate a bit more, then it would look like this:
>
> class LaunchFwkStep(shell.ShellCommand):
>
>    timeout=3600
>    haltOnFailure=False
>    description=[list + " - In progress"]
>    descriptionDone=[list + " - Done"])
>    command=[launchfwk, "-f V2", "-a 2.3", "-n " + str(archi), "-l "+
> str(list), "-s " + str(syslogarchi[archi])]
>
>    def __init__(self, branch=None, revision=None, **kwargs):
>        self.branch = branch
>        self.revision = revision
>        ShellCommand.__init__(**kwargs)
>        self.addFactoryArguments(branch = branch, revision = revision)
>
>
>    def start(self):
>        if self.branch:
>            command.extend(['-p', branch])
>        if self.revision:
>            command.extend(['-b', revision])
>
> And your addStep would look like:
>
> f.addStep(
>    LaunchFwkStep,
>    branch = WithProperties("%s", "branch"),
>    revision = Withproperties("%s", "revision"))
>
> Hope this helps.
> Ben
>
>
> ------------------------------------------------------------------------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> 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/20110315/f854944e/attachment.html>


More information about the devel mailing list