[Buildbot-devel] using addURL

Nikunj Badjatya nikunjbadjatya at gmail.com
Thu May 19 09:44:12 UTC 2011


Dear Members,

I am using,

Buildbot version: 0.7.12
Twisted version: 9.0.0
Python version 2.6.6
CentOS 5.6

I wanted to use addURL function. So as to give custom URLs in each build
step.
I referred the manual for it. The contents in it are shown below.

{{{

To set one of these links, the BuildStep should call the addURL method with
the name of the link and the target URL. Multiple URLs can be set.

In this example, we assume that the make test command causes a collection of
HTML files to be created and put somewhere on the coverage.example.org web
server, in a filename that incorporates the build number.


     class TestWithCodeCoverage(BuildStep):
         command = ["make", "test",
                    WithProperties("buildnum=%s", "buildnumber")]

         def createSummary(self, log):
             buildnumber = self.getProperty("buildnumber")
             url = "http://coverage.example.org/builds/%s.html" % buildnumber
             self.addURL("coverage", url)

You might also want to extract the URL from some special message output by
the build process itself:

     class TestWithCodeCoverage(BuildStep):
         command = ["make", "test",
                    WithProperties("buildnum=%s", "buildnumber")]

         def createSummary(self, log):
             output = StringIO(log.getText())
             for line in output.readlines():
                 if line.startswith("coverage-url:"):
                     url = line[len("coverage-url:"):].strip()
                     self.addURL("coverage", url)
                     return

}}}
I found it sligtly difficult to understand as to ,
1) Do I have to make my own class like the one above. and define custom
function. ??
2) when I use "f.addStep()" where exactly I need to put/call "createSummary"
function.


Please provide a simple example to understand this.


Thanks,


Nikunj
Bangalore, India
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20110519/1c3c1b08/attachment.html>


More information about the devel mailing list