[Buildbot-devel] Using Properties numerically

Richard Offer richard at whitequeen.com
Sat May 5 04:06:18 UTC 2012


On May 4, 2012, at 11:56 AM, Tom Prince wrote:

> On Fri, 4 May 2012 10:08:20 -0700, Richard Offer <richard at whitequeen.com> wrote:
>> I need/want to be able to use a property value numerically, i.e.
>> 
>>        set_properties = { 
>>            'SAUSAGEBOT_BUILDID' : 40000 + int( buildbot.process.properties.WithProperties("%(buildnumber:-0000)s") ), 
>>        },
> 
> You can use Property instead of WithProperties to get a number, assuming
> that the property was originally specified as number (i.e. not set by
> SetProperties, for example).
> 
> But, that won't allow you do arithmetic with it like you show above. The
> trouble is that the code written is evaluated at configure time, but you
> need the calculation done at build time. The way to do that, is to write
> an IRenderable instance that does what you want. (This basically
> involves writting a class with a method getRenderingFor.
> 
>> Our existing build code (using bamboo) is all environment variable
>> driven, trying to get Properties in sync with environment variables
>> has proved to be magic - and not the good type…
> 
> You don't necessarily need to keep them in sync. You can specify
> environment varialbes on the slave or builder or on indivual build
> steps. And if you want these to depend on properties, you can use
> WithProperties in the dicts these take.


I was a bit misleading - the problem wasn't so much variables it was keeping the build steps synchronized with what the underlying cmake/make files knew about the build.

The old bamboo system used globs to upload files so it didn't need to know the exact details about what the build id was (its used as the RPM release number and hence is in the filename).

I made the decision to build some of those details in the buildbot system so I could use the official buildbot means of file transfer (rather than a shell call to rsync) - but that meant having to d things like calculate the build id in buildbot and then pass it down to make`1.

It was that that took so long - and I still don't have what I want - but I have what I need…..


> 
>  Tom




Thanks for the suggestion - not sure if I'll do it (want vs need)…



richard.



More information about the devel mailing list