[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.

shiny knight theshinyknight at me.com
Mon Feb 11 04:12:57 UTC 2013


Thanks for your insight Dan,

I was not aware of the addURL, that's quite useful!

Will give a try to see if it will work in my case; looking at your example I had few implementation ideas in mind.

I also checked the FileUpload, and seems to be the only solution to my problem (show in a step a link to download a file). I do not understand why I am forced to have to upload to the master but it seems to be the only way to achieve what I need; maybe I should write an ER ticket to request to have a function that allows the step class to specify a link on the slave (the most common case that pops in my mind is a patch...you can make a build with a patch and allow users to download it directly from the slave).

Thanks for your replies!

On Feb 10, 2013, at 5:52 PM, Dan Kegel wrote:

> 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
> 
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013 
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel





More information about the devel mailing list