layout: post title: ASF Buildbot svn setup date: ‘2010-03-29T10:25:59+00:00’ permalink: asf_buildbot_svn_setup

pieces = changed_file.split(os.sep)
#Assume the layout is something like :
# trunk => foo/bar/baz/trunk/file
# branches/test  => foo/bar/baz/branches/test/file
# Slurp everything up to one of these 2 'markers' and call that the branch
found = False

f = open(project_paths, 'r')
for line in f.readlines():
    line = line.strip()
    regexp = re.compile(line)
    m = regexp.match(changed_file)
    if m:
        branch = m.group(1)
        path =   m.group(2)
        print >> sys.stderr, "branch=%s, path=%s" % (branch, path)
        return (branch, path)


i = 0
for piece in pieces:
    i = i + 1	
    # Find trunk, we are done
    if piece == 'trunk':
        found = True
        break
    elif piece == 'branches':
        i = i + 1
        found = True
        break
    
# We found a layout we know, so send it to buildbot
if found:
    branch = os.path.join(*pieces[0:i]) 
    path =   os.path.join(*pieces[i:])
else:        
    branch = pieces[0]
    path = os.path.join(*pieces[1:])
        
print >> sys.stderr, "branch=%s, path=%s" % (branch, path)
return (branch, path)     
   
#return (pieces[0], os.path.join(*pieces[1:]))

raise RuntimeError("cannot determine branch for '%s'" % changed_file)

split_file = split_file_branches

c[‘schedulers’].append(AnyBranchScheduler(name="on-wookie-commit", branches=["incubator/wookie/trunk"], treeStableTimer=2, builderNames=["wookie-trunk"]))

#builders

f28 = factory.BuildFactory() f28.addStep(SVN( mode="clobber", baseURL="http://svn.apache.org/repos/asf/", defaultBranch="incubator/wookie/trunk", haltOnFailure=True, ))

etc...