[Buildbot-devel] FileUpload question

Brian Warner warner-buildbot at lothar.com
Mon Dec 25 19:11:28 UTC 2006

"Leibowitz, Michael" <michael.leibowitz at intel.com> writes:

> I want to use FileUpload to upload the results of my builds, but I need
> to differentiate them from each other somehow.  How can I change the
> masterdest to use some of the build properties to make unique, but human
> readable file names?

Yeah, the filename doesn't currently accept a WithProperties specification.
The easiest way to accomplish this is probably to override the start() method
and have it modify the masterdest filename based upon whichever properties
you need:

class MyUpload(transfer.FileUpload):
    def start(self):
        bname = self.getProperty("buildername")
        bnumber = self.getProperty("buildnumber")
        self.masterdest = "%s/%s-install_set.zip" % (bname, bnumber)
        return transfer.FileUpload.start(self)

As an enhancement, it'd be nice to have FileUpload just accept a
WithProperties, so you could do this instead:

 f1.addStep(FileUpload, slavesrc="install_set.zip",
                                      "buildername", "buildnumber"))

If you file an enhancement request on buildbot.sf.net for this, I'll see if I
can find a good way to implement it.


More information about the devel mailing list