[Buildbot-devel] please help, I can't get this to work

rmdugal at hotmail.com rmdugal at hotmail.com
Mon Aug 10 23:30:38 UTC 2009


I am very new to buildbot and python and I am trying to figure out how to make this work. 
I want the CVS module and branch/tag to be controlled by the contents of buildbot.ini
Basically I want to do this:

1. check out the file buildbot.ini. This file will look like this
  [somesection]
  cvsmodule=somemodule 
  cvstag=sometag
2. parse the file to find the cvs module and tag for some section that is passed from an environment variable
3. check out source using cvsmodule and cvstag
4. build that code


You might ask why do I want to do this? 
- that's what our legacy build system does
- changing the build's module/tag for a particular slave would only require changing the .ini file 


This is basically what a section of my master.cfg looks like, minus all the (I hope) unimportant details.


class MyCVS(CVS):
    def startVC(self, branch, revision, patch):
            config = ConfigParser.RawConfigParser()
            config.read( './ini/buildbot.ini' )
            
            # parse buildbot.ini get cvsmodule and cvstag from section 'FOO'. 
            # Note 'FOO' is hard coded here but in reality would come from another property
            # Both these always fail with exception ConfigParser.NoSectionError
            cvsmodule = config.get('FOO', 'cvsmodule')
            cvsbranch = config.get('FOO', 'cvsbranch')
            self.cvsmodule=cvsmodule
            self.branch=cvsbranch
            CVS.startVC(self, branch=cvsbranch, revision=revision, patch=patch)

class BuildAndTestFactory(factory.BuildFactory):
        def __init__(self, mode, branch):
                factory.BuildFactory.__init__(self)
                # Check out buildbot.ini 
                self.addStep(CVS(cvsroot=cvs_root, cvsmodule='eng/build/buildbot.ini', mode='clobber', branch=cvs_branch,workdir='ini'))
                # Check out source using cvsmodules and cvstag from buildbot.ini 
                self.addStep(MyCVS(cvsroot=cvs_root, cvsmodule=cvs_sslc_module, mode=mode, alwaysUseLatest=True, branch=cvs_branch))


  
But it doesn't work. I've tried several different variations of this, like different variations of the path to buildbot.ini, but nothing works.
I know buildbot.ini does get checked out and a simple python script executed on the slave does parse it correctly.
But when the MyCVS step is executed it doesn't work.

What am I doing wrong?

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20090810/61c84463/attachment.html>


More information about the devel mailing list