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

Alex castornightmare at gmail.com
Mon Mar 14 17:32:47 UTC 2011


Benoit,

thanks for your help, it is very nice.
Maybe my question is stupid but, are the branch and revision variables
really exists ?
If yes, is the code should look like this or am i missing something :

class LaunchFwkStep(shell.ShellCommand):
    def start(self):
        if self.branch:
            command.extend(['-p', branch])
        if self.revision:
            command.extend(['-b', revision])
...
        f.addStep(
            LaunchFwkStep,
            command=[launchfwk, "-f V2", "-a 2.3", "-n " + str(archi), "-l
"+ str(list), "-s " + str(syslogarchi[archi]),
WithProperties("%s","branch"), WithProperties("%s", "revision")],
            timeout=3600,
            haltOnFailure=False,
            description=[list + " - In progress"],
            descriptionDone=[list + " - Done"])


Thanks again,

Alex
Le 14 mars 2011 16:39, Benoît Allard <benoit at aeteurope.nl> a écrit :

> Alex wrote:
>
>> My example is wrong, no doubt about this ... anyway do you know a way to
>> achieve what i need to do ?
>>
>>
> You can proably write your own step that inherit from ShellCommand, and use
> python to define your command inside the start method, idealy, your new step
> would have two parameters: branch and revision, feeded with WithProperties,
> and the start command would look like:
>
> def start(self):
>  if self.branch:
>    command.extend(['-p', branch])
>  if self.revision:
>    command.extend(['-b', revision])
>
> Benoit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20110314/1ed856b7/attachment.html>


More information about the devel mailing list