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

Benoît Allard benoit at aeteurope.nl
Tue Mar 15 08:49:15 UTC 2011

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

     branch = WithProperties("%s", "branch"),
     revision = Withproperties("%s", "revision"))

Hope this helps.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6370 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://buildbot.net/pipermail/devel/attachments/20110315/a74adb77/attachment.bin>

More information about the devel mailing list