[Buildbot-devel] messageFormatter to grab logs from the waterfall page, and how to add on the waterfall page a link to a zip file on the slave.

Dan Kegel dank at kegel.com
Mon Feb 11 01:52:16 UTC 2013


Here's how I added a link to build artifacts.

http://buildbot.net/buildbot/docs/0.8.5/reference/buildbot.process.buildstep.BuildStep-class.html#addURL
says
"An HREF to this URL will be added to any HTML representations of this
step. This allows a step to provide links to external web pages,
perhaps to provide detailed HTML code coverage results or other forms
of build status."

http://buildbot.net/buildbot/docs/0.8.5/reference/buildbot.steps.shell.ShellCommand-class.html
says
"To create additional summary Logs, override my .createSummary method."

So here's what I cooked up:

class LinkedShellCommand(ShellCommand):
    """A shell command that adds a URL to the build resuilts."""
    def __init__(self,**kwargs):
         ShellCommand.__init__(self,**kwargs)

    def createSummary(self,log):
         # FIXME: make this configurable
         rooturl = "http://buildhost3/repobot"
         stability = self.getProperty("stability")
         buildername = self.getProperty("buildername")
         buildnumber = self.getProperty("buildnumber")
         artifact_url = "%s/%s/builds/%s/%d/" % (rooturl, stability,
buildername, buildnumber)
         self.addURL("artifacts", artifact_url)

Then when I'm creating my steps, I use that special shellcommand for
the step that does the upload.

            for step in ["patch", "install_deps", "configure",
"compile", "check", "package", "upload", "compile_extra",
"uninstall_deps"]:
                if step == "upload":

factory.addStep(LinkedShellCommand(command=["../../srclink/" + name +
"/buildshim", step], description=step, haltOnFailure=True))
                else:

factory.addStep(ShellCommand(command=["../../srclink/" + name +
"/buildshim", step], description=step, haltOnFailure=True))

There's probably an easier way, but this worked for me.
- Dan




More information about the devel mailing list