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

Alex castornightmare at gmail.com
Thu Mar 17 16:30:06 UTC 2011


Thanks very much guys for your help.

I finished by add that in my master.cfg file :
================================
class LaunchFwkStep(step.ShellCommand):
    timeout=3600
    haltOnFailure=False
    description=[str(list) + " - In progress"]
    descriptionDone=[str(list) + " - Done"]

    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])

then ...
        f.addStep(
            LaunchFwkStep,
            branch = WithProperties("%s", "branch"),
            revision = WithProperties("%s", "revision"),
            command=[launchfwk, "-f V2", "-a 2.3", "-n " + str(archi), "-l
"+ str(list), "-s " + str(syslogarchi[archi])])
================================
then my buildbot master restart nicely but when i force a build i get a
"setupBuild exception".

On my slave twistd.log file, i only see those logs :
================================
2011-03-17 17:25:17+0100 [Broker,client]
SlaveBuilder.remote_print(Supermedium-1): message from master: ping
2011-03-17 17:25:17+0100 [Broker,client]
SlaveBuilder.remote_ping(<SlaveBuilder 'Supermedium-1' at 140427084>)
2011-03-17 17:25:17+0100 [Broker,client] <SlaveBuilder 'Supermedium-1' at
140427084>.startBuild
================================
An idea to have more debug ?

Thanks again.


Le 15 mars 2011 17:54, Axel Hecht <l10n.moz at googlemail.com> a écrit :

> 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/20110317/0a561028/attachment.html>


More information about the devel mailing list