Reputation: 11
Question related to Buildbot : I acquired the build details (like branch, repository, buildnumber etc) of the triggered build using classes and methods like util.Interpolate and util.Property etc.
Example :
factory.addStep(
steps.ShellCommand(
command=util.Interpolate('echo %(prop:buildnumber)s %(prop:branch)s > /tmp/build_details.txt'),
.....))
I need to perform some actions based on these values. Like creating a folder, OR setting a python variable in the program etc.
Currently, in my buildbot script, I am storing them in a file on the system. And then try to retrieve the file contents etc. Is there any way if we can store these values in python variables and then use them in conditional statements?
Since 2 builds can be triggered at the same time, the idea of storing values in files is not optimum.
Upvotes: 0
Views: 172
Reputation: 46
You'll need to either use the Interpolation class replacement to alter how a property is rendered (https://docs.buildbot.net/1.8.0/manual/configuration/properties.html#interpolate) or you can use a custom renderer which uses python to determine how to render the value. Just beware that you will only be able to use this when passing a renderer object is possible. Custom renderer (https://docs.buildbot.net/1.8.0/manual/configuration/properties.html#interpolate)
Upvotes: 0