[Buildbot-devel] are Build Properties available in all steps?
Philippe McLean
philippe.mclean at gmail.com
Tue Feb 22 23:02:53 UTC 2011
thanks. the mistake was writing
step.GetProperty("buildnumber")
instead of
step.getProperty("buildnumber")
thank you!
On Tue, Feb 22, 2011 at 10:13 AM, Amber Yust <ayust at yelp.com> wrote:
> Try step.build.properties instead.
>
> ~Amber
>
> On Tue, Feb 22, 2011 at 9:56 AM, Philippe McLean <
> philippe.mclean at gmail.com> wrote:
>
>> 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'
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Free Software Download: Index, Search & Analyze Logs and other IT data in
>> Real-Time with Splunk. Collect, index and harness all the fast moving IT
>> data
>> generated by your applications, servers and devices whether physical,
>> virtual
>> or in the cloud. Deliver compliance at lower cost and gain new business
>> insights. http://p.sf.net/sfu/splunk-dev2dev
>> _______________________________________________
>> 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/20110222/e245663c/attachment.html>
More information about the devel
mailing list