[Buildbot-devel] mutliple svn branches
    David Froger 
    david.froger at gmail.com
       
    Tue Nov 22 08:36:33 UTC 2011
    
    
  
Hy,
I'm new to buildbot, so sorry if the answer is evident...
What I'm trying to do is:
    svn checkout https://path/to/my/repo/trunk trunk
    svn checkout https://path/to/my/repo/data other_data_name
    cd trunk
    make
    ./configure
    cd trunk/tests/test0
    make test # read data from ../../../other_data_name
The documentation
    http://buildbot.net/buildbot/docs/current/manual/cfg-buildsteps.html
says:
    Alternatively,  if you are building from multiple branches,  then you should
    preferentially  create  the SVN  step  with  the  baseURL  and defaultBranch
    arguments instead:
I'm trying to  to so.  With the below master.cfg,  the  first SVN step correctly
download trunk branch.  I  expect  the  second  SVN  step  to  download the data
branch, but it just update the trunk branch.
I don't understand how %%BRANCH%% is set.  The doc of baseURL says:
    For flexibility,  baseURL may contain  a %%BRANCH%% placeholder,  which will
    be  replaced  either  by  the  branch  in  the  SourceStamp  or  the default
    specified in defaultBranch.
Does it means I have to set a SourceStamp for "trunk" and another for "data" ?
So my two questions are:
   - how to download both "trunk" and "data" branches?
   - Is it possible to download branch "data" into a directory "other_data_name", 
     like with the command line:
         svn checkout https://path/to/my/repo/data other_data_name ?
     I tried to use extra_args, but it ends up with something like:
         svn checkout https://path/to/my/repo/data . options extra_args
Thanks for reading and for any help.
Best regards,
David.
The master.cfg file:
c = BuildmasterConfig = {}
import os
####### BUILDSLAVES
from buildbot.buildslave import BuildSlave
c['slaves'] = [BuildSlave("ubuntu-10.04", "MX412%,")]
c['slavePortnum'] = 9989
####### CHANGESOURCES
# I do not setup change_source, because I'm forcing build manually
from buildbot.changes.svnpoller import SVNPoller
####### SCHEDULERS
# I do not setup schedulers, because I'm forcing build manually
c['schedulers'] = []
####### BUILDERS
from buildbot.process import factory
f = factory.BuildFactory()
# check out the source
from buildbot.steps.source.svn import SVN
#checkout source code
f.addStep( \
    SVN( \
        baseURL='https://path/to/my/repo/%%BRANCH%%',
        defaultBranch='trunk',
        username="myusername",
        password="mypassword",
        mode='incremental',
        haltOnFailure=True,
    ),
)
f.addStep( \
    SVN( \
        baseURL='https://path/to/my/repo/%%BRANCH%%',
        defaultBranch='data',
        username="myusername",
        password="mypassword",
        mode='incremental',
        haltOnFailure=True,
    ),
)
# configure
from buildbot.steps import shell
f.addStep( \
    shell.Configure( \
        workdir='./build/trunk',
        haltOnFailure=True,
    ),
)
# compile
f.addStep( \
    shell.Compile( \
        command=["make",],
        workdir='./build/trunk',
        haltOnFailure=True,
    ),
)
# run the tests (note that this will require that 'trial' is installed)
from buildbot.steps.shell import Test
f.addStep( \
    Test( \
        command=["make","test",]
        workdir='build/trunk/tests/test0',
    ),
)
from buildbot.config import BuilderConfig
c['builders'] = []
c['builders'].append(
    BuilderConfig(
      name="runtests",
      slavenames=["ubuntu-10.04"],
      factory=f,
      )
    )
####### STATUS TARGETS
c['status'] = []
from buildbot.status import html
from buildbot.status.web import authz
authz_cfg=authz.Authz(
    # change any of these to True to enable; see the manual for more
    # options
    gracefulShutdown = False,
    forceBuild = True, # use this to test your slave once it is set up
    forceAllBuilds = False,
    pingBuilder = False,
    stopBuild = False,
    stopAllBuilds = False,
    cancelPendingBuild = False,
)
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
c['title'] = "myproject"
c['titleURL'] = "mywebsite"
c['buildbotURL'] = "http://localhost:8010/"
####### DB URL
c['db_url'] = "sqlite:///state.sqlite"
-- 
    
    
More information about the devel
mailing list