[Buildbot-devel] are Build Properties available in all steps?

Philippe McLean philippe.mclean at gmail.com
Tue Feb 22 17:56:42 UTC 2011


I'm trying to do a clean build every X steps (this is a followup to an
earlier discussion).
I wrote a predicate on the SVN step, but the buildnumber Property does not
seem to be available to the SVN step (should I be asking an object inside
the step?)

(using buildbot 0.8.3 on Windows 2008)

My master.cfg:



def Purge(step):
    # purge the build every 4 builds
    modulus = 2
    buildnumber = int(step.GetProperty("buildnumber"))
    if ((buildnumber % modulus) == 0):
        return True
    else:
        return False

def DoNotPurge(step):
    if Purge(step):
        return False
    else:
        return True

# This build does an incremental of the DAVeOrders branch.
f3 = factory.BuildFactory()
f3.addStep(source.SVN(mode='update', baseURL='svn://XXX/',
defaultBranch='branches/XXX', always_purge=True, doStepIf=Purge))
f3.addStep(source.SVN(mode='update', baseURL='svn://XXX/',
defaultBranch='branches/XXX', always_purge=False, doStepIf=DoNotPurge))

The error:

Traceback (most recent call last):
  File
"C:\Python27\lib\site-packages\buildbot-0.8.3p1-py2.7.egg\buildbot\process\buildstep.py",
line 742, in startStep
    d.addCallback(self._startStep_2)
  File "C:\Python27\lib\site-packages\twisted\internet\defer.py", line 297,
in addCallback
    callbackKeywords=kw)
  File "C:\Python27\lib\site-packages\twisted\internet\defer.py", line 286,
in addCallbacks
    self._runCallbacks()
  File "C:\Python27\lib\site-packages\twisted\internet\defer.py", line 542,
in _runCallbacks
    current.result = callback(current.result, *args, **kw)
--- <exception caught here> ---
  File
"C:\Python27\lib\site-packages\buildbot-0.8.3p1-py2.7.egg\buildbot\process\buildstep.py",
line 779, in _startStep_2
    elif not self.doStepIf(self):
  File "D:\buildbot-master\master.cfg", line 378, in Purge
    buildnumber = int(step.GetProperty("buildnumber"))
exceptions.AttributeError: SVN instance has no attribute 'GetProperty'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20110222/41ecf7af/attachment.html>


More information about the devel mailing list