[Buildbot-devel] string values from Force Build form

Steve Bachor steve.bachor at netronome.com
Tue May 13 19:45:25 UTC 2014


Hello,

We have been using buildbot version 0.7.9 for quite some time with much 
success, thank you to the developers and the community.  We are 
considering moving to latest version.

....but, if somebody can help me getting this to work with the version 
0.7.9 for now, it would be greatly appreciated. I suspect most of this 
may be similar to latest version.

I am simply trying to access the string values for the "Your name", 
"Reason for build", "Branch to build", and "Revision to build" fields 
that I have entered on the Force Build form prior to clicking the "Force 
Build" button.  I am trying to access these string values from 
master.cfg in the BUILDERS section prior to calling addStep.  I want to 
copy these string values to new local variables for additional 
processing/error checking and then pass the new local variables in addStep.

Here's similar to what I want to do:

---------------------------------------------------
smoke_factory = factory.BuildFactory()

myname = ("Your name" string value from Force Build form)
myreason = ("Reason for build" string value from Force Build form)
mybranch = ("Branch to build" string value from Force Build form)
myrevision = ("Revision to build" string value from Force Build form)

// pseudocode for processing the strings held by myname, myreason, 
mybranch, and myrevision
// also access buildnumber here

smoke_factory.addStep(ShellCommand(descriptionDone="Finished Task",
                                        description="Performing Task",
                                        workdir="/mybuilddir",
                                        timeout=timeout,
                                        command=["mypythonscript.py",
                                                  myname,
                                                  myreason,
                                                  mybranch,
                                                  myrevision]))
-------------------------------------------------------------

We have been able to use WithProperties("%(branch)s") and 
WithProperties("%(revision)s") as a parameter to the "mypythonscript.py" 
but a couple problems with that:
1. WithProperties("%(branch)s") and WithProperties("%(revision)s") 
return an object not a string, I found documentation that said something 
like "these are converted to a string only when passed to the buildslave".
2. name and reason are not available to WithProperties, only branch and 
revision.

I briefly tried getting the above string values from log files without 
success.

Additionally, it would be great to access the buildnumber in the same 
section of code (see above)

Thanks in advance,

Steve






More information about the devel mailing list