Interpolate won't work when passing a property (triggered builder, which will use the property as parameter in a step)

北城余情 提交于 2019-12-11 18:46:16

问题


The scenario: I have various builder, that trigger a builder B. The builder B needs to know a specific piece of data, which is a string, so it knows what operation has to perform.

Example: 3 builders build 3 version of the same software, but each one is for a different architecture; I need to pass the architecture to builder B, which does testing, so it does the testing for the right architecture. So when a builder start, triggers B, which gets the architecture as parameter, and pass it to a step.

How can I pass a value trough the triggerable builder step in builder A, which then will be used by a step in builder B?

I could simply avoid to have builder B and run an instance of the work for each of my builders

Any code example would be very welcome; found no trace of a working example anywhere.

Update:

OK, I am getting closer I guess; using properties; you need to

import Properties

from buildbot.process.properties import Property

Then in the triggerable step, you need to make a property

f.builderA.addStep (trigger.Trigger(schedulerNames= ['scheduler1']. set_properties={ "arch":Property("x86")}))

Last step is to interpolate the parameter and use it in the step on builderB:

f.builderB.addStep(testarch (architecture=(Interpolate(%(prop:arch))))

Problem is: I get an error where i restart the master, because my step is expecting a string for arch, and instead it says that it gets an "interpolate"

exceptions.TypeError: cannot concatenate 'str' and 'Interpolate' objects

Why it is not passing the string as expected? I tried to cast it as str() and it just print the Interpolate command, like if it was not processed.

来源:https://stackoverflow.com/questions/23864100/interpolate-wont-work-when-passing-a-property-triggered-builder-which-will-us

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!