[Buildbot-devel] WithProperties?

Christian Unger christian.unger at me.com
Tue Dec 14 21:41:20 UTC 2010


cool!

I'll give it a try.
thanks much!!

and actually: nope the source step doesn't support WithProperties.
(which would be cool by the way)
cheers

On 14.12.2010, at 22:32, Alexander O'Donovan-Jones wrote:

> You can hax this already, using the doStepIf. It has access to the step and it‘s properties, and is pretty handy for mutating them.
>  
> From: Amber Yust [mailto:ayust at yelp.com] 
> Sent: 14 December 2010 21:30
> To: Christian Unger
> Cc: buildbot-devel list
> Subject: Re: [Buildbot-devel] WithProperties?
>  
> If you're willing to update to the latest GitHub master release, I recently added support to WithProperties for evaluation of functions to determine substitutions, so you can do something like this:
>  
> foo=WithProperties('%(bar)s', bar=lambda props: someval)
>  
> This would let you slice and dice the branch property if you desired. I don't think the source step supports WithProperties in the defaultBranch (I think that argument is evaluated at config-time, not run-time), so trying to use WithProperties there probably wouldn't work.
>  
> ~Amber
> 
> On Tue, Dec 14, 2010 at 12:59 PM, Christian Unger <christian.unger at me.com> wrote:
>  
>  
> I seem to understand what is going on here,
> and thanks much for opening my eyes :-)
>  
> ok, I can add a named property and am able to access it through interpolation.
> and yes I can make this a convention here and make everyone enter projectName as a property when they are building.
> still I'd either like to extract projectName from the branch property or have the default branch use projectName interpolation
> like so:
>  
>    source.SVN(mode='clobber', username=private.svnlogin, password=private.svnpass,
>                 baseURL=checkout.projectsBaseURL, defaultBranch=WithProperties("%(projectName)s/trunk"),
>                 locks=[tag_lock.access('exclusive')]),
>     
>     ShellCommand(command=['time', './deploy.command', '--stage', 'dev'],
>                     description="preparing staging tags",
>                     descriptionDone="creating devtag",
>                     haltOnFailure=True, locks=[tag_lock.access('exclusive')]),
>     
>     source.SVN(mode='clobber', username=private.svnlogin, password=private.svnpass,
>                 baseURL=checkout.projectsBaseURL, defaultBranch=WithProperties("%(projectName)s/tags/current"),
>                 locks=[tag_lock.access('exclusive')]),
>  
>  
> anyone?
>  
>  
>  
>  
>  
> On 14.12.2010, at 17:33, Amber Yust wrote:
> 
> 
> If your property is named projectName, then...
>  
> where you'd normally have, say, foo='blah/tags/current'
>  
> Instead, use the following:
>  
> foo=WithProperties('%(projectName)s/tags/current')
>  
> (Note - this isn't a regex, it's Python string interpolation with a few extra syntaxes.)
>  
> ~Amber
> 
> On Tue, Dec 14, 2010 at 7:59 AM, Christian Unger <christian.unger at me.com> wrote:
>  
> I'm sorry, but I am really having a hard time wrapping my brain around properties in buildbot.
>  
> so I have a BuildFactory, where I do an svn source checkout of 'projectName/trunk',
> where projectName is dynamic and can be set on the waterfall page as the branch property.
> the next step tags this as 'projectName/tags/current' by using a shell script which is able to determine the projectName without buildbot interaction.
>  
> now the third step should be able to checkout  'projectName/tags/current' and retrieve projectName from the build properties.
> my question is how to inject a regex into my build steps which extracts this string from the branch property.
>  
> any help very much appreciated
>  
> thanks in advance
>  
> __
> cu
> christian unger
>  
>  
>  
>  
>  
> 
>  
> 
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
> 
>  
>  
> __
> cu
> christian unger
>  
>  
>  
>  
>  
> 
>  
>  


--
christian unger • pferdeweide  47 • 22589 hamburg, germany
-------------------------------------------------------------------------------
fon +49 16090987304
fon +49 4097073763 • fax +49 4097073765
--------------------------------------------------------------------
aim christian_unger at mac.com
skype c_unger




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20101214/454fd4f0/attachment.html>


More information about the devel mailing list