[Buildbot-devel] [Need help] with "got_revision" for multi-codebase builds in build steps

sanjuro at openmailbox.org sanjuro at openmailbox.org
Fri Jan 9 08:59:12 UTC 2015


On 2015-01-05 15:45, Jared Grubb wrote:
> Interpolate works well for simple substitution.
> 
> However, for this purpose, you probably would do better doing a custom
> render function:
> 
>    from buildbot.process import properties
> 
>    @properties.renderer
>    def create_filename(props):
>        got_revision = props.getProperty(‘got_revision’)
>        rev = got_revision.get(‘Repo3’, ‘(unknown)’)
> 
>       # If you need the sourcestamp, you can do something like:
>       # ss = props.getBuild().getSourceStamp(‘Repo3’)
> 
>        return rev
> 
> Jared
> 
>> On Jan 5, 2015, at 04:26, sanjuro at openmailbox.org wrote:
>> 
>> I need to generate build filename string in a buildstep.
>> 
>> Interpolate("%(prop:got_revision)s")
>> 
>> produces just a dictionary:
>> 
>> { 'Repo1': '12345',
>>  'Repo2': '54321',
>>  'Repo3': '56789' }
>> 
>> But how can I directly use this dictionary to generate such filename?
>> 
>> "Repo1_12345_Repo3_56789"
>> 
>> Note: I also need to exclude 'Repo2' part.
>> 
>> 
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming! The Go Parallel Website,
>> sponsored by Intel and developed in partnership with Slashdot Media, 
>> is your
>> hub for all things parallel software development, from weekly thought
>> leadership blogs to news, videos, case studies, tutorials and more. 
>> Take a
>> look and join the conversation now. http://goparallel.sourceforge.net
>> _______________________________________________
>> Buildbot-devel mailing list
>> Buildbot-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/buildbot-devel

Thanks. I already implemented renderer like you wrote.
Only instead of below expression:

>        rev = got_revision.get(‘Repo3’, ‘(unknown)’)

I prefer to use simple dictionary style:

         rev = got_revision['Repo3']





More information about the devel mailing list