[Buildbot-devel] My doxygen step

VITTORIA Claude BU IT&L@bs claude.vittoria at orange-ftgroup.com
Wed Feb 25 07:46:27 UTC 2009


Hi,

I wrote some time ago my "step" to transfere generated files in a tar
archive and to untar on the master system.
I wrote that to solve a problem of bandwith (VPN between site and ssh
forbidden)and short window time to transfer (not sure that 393 solves my
problem). The buildmaster server also is my web server (same storage but
different systems in reality).

The following code has no pretension, I wrote to solve a problem and I
share an experience. The code below has been written for 0.7.8. All
ideas to improve are wellcome. The main issue, I suppose, is that master
is "blocked" during untar step, not fair if an heavy load, how to
"thread" it ?

Claude
===========================================================================
Master step only
===========================================================================
class untar(BuildStep):

    def __init__ (self, tarpath='*', tarmask='',
tardescription='Untar',**buildstep_kwargs):
        self.tarpath=tarpath
        self.tarmask=tarmask
        self.tardescription=tardescription
        BuildStep.__init__(self, **buildstep_kwargs)
        self.addFactoryArguments(tarpath=tarpath,
                                 tarmask=tarmask,
                                 tardescription=tardescription)
        
    def start(self):
        source = os.path.expanduser(self.tarpath)
        self.step_status.setColor('yellow')
        self.step_status.setText(['Inflating'])
        status = os.system('tar xvf "%s"'%(source))
        if self.tarmask != '':
            sourcech = os.path.expanduser(self.tarmask)
            status = os.system('chmod o+rx "%s"'%(sourcech))
            status = os.system('chmod -R o+r "%s"'%(sourcech))

        if status == 0:
            self.step_status.setColor('green')
            self.step_status.setText([self.tardescription,
os.path.basename(source)])
            return BuildStep.finished(self, SUCCESS)
        else:
            self.step_status.setColor('red')
            self.step_status.setText(["Untar",
os.path.basename(source)])
            return BuildStep.finished(self, FAILURE)
===================================================================================
factory conf
===================================================================================
f.addStep(ShellCommand(command=["make", "doc"])),
f.addStep(ShellCommand(command=["tar", "cvf", "doxygen.tar",
"doc/html"], haltOnFailure = 1)),
f.addStep(FileUpload(slavesrc="doxygen.tar",
                          masterdest="~buildmaster/doc/doxygen.tar")),
f.addStep(untar(tarpath="~buildmaster/doc/doxygen.tar",
tarmask="~buildmaster/doc/html", tardescription="<a href=
\"http://buildbot/AIS007C1/doxygen\">Doxygen</a>"))





More information about the devel mailing list