Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
290 views
in Technique[技术] by (71.8m points)

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...