Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
adjusted for github repos
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Groszer committed Jan 8, 2013
1 parent 71f4257 commit 6723a8e
Show file tree
Hide file tree
Showing 2 changed files with 252 additions and 172 deletions.
126 changes: 102 additions & 24 deletions master.cfg
Expand Up @@ -948,7 +948,7 @@ if 'py_254_win32' in ZODB_DEV_PLATFORMS:
del ZODB_DEV_PLATFORMS['py_254_win32']


def ZODB_dev_builder(name, slavename, platform, locks):
def ZODB_dev_builder_svn(name, slavename, platform, locks):
builddir = name.replace(' ', '_')
f = factory.BuildFactory()
f.addStep(SVN(
Expand Down Expand Up @@ -990,6 +990,43 @@ def ZODB_dev_builder(name, slavename, platform, locks):
locks=locks)


def ZODB_dev_builder_git(name, slavename, platform, locks):
branch = 'HEAD'
builddir = name.replace(' ', '_')
f = factory.BuildFactory()
f.addStep(Git(
repourl="git://github.com/zopefoundation/ZODB.git",
haltOnFailure=True,
mode="copy",
branch=branch))

lc = LastChangeGit()
#lc.url_template = 'http://zope3.pov.lt/trac/log/zc.buildout?rev=%s'
f.addStep(lc)

f.addStep(shell.ShellCommand(
command=[platform.python, r"c:\buildmaster\bootstrap.py"],
haltOnFailure=True,
name="bootstrap",
description="bootstrap"))
f.addStep(shell.ShellCommand(
command=platform.withcompiler % r"bin\buildout.exe",
haltOnFailure=True,
name="buildout",
description="buildout",
timeout=3600))
f.addStep(Test(
command=[r"bin\test.exe", "--exit-with-status", "-1"],
haltOnFailure=False,
name="test",
description="test trunk"))
return dict(name=name,
slavename=slavename,
builddir=builddir,
factory=f,
locks=locks)


def setup_ZODB_dev_tests(slow_lock, hour=02, minute=40):
#hour = 02
#minute = 40
Expand All @@ -999,7 +1036,7 @@ def setup_ZODB_dev_tests(slow_lock, hour=02, minute=40):
name = "ZODB_dev %s" % platform.name
builders.append(name)
c['builders'].append(
ZODB_dev_builder(name, 'local', platform, [slow_lock]))
ZODB_dev_builder_git(name, 'local', platform, [slow_lock]))

c['schedulers'].append(
Nightly( "%s_nightly" % name, [name], hour=hour, minute=minute))
Expand Down Expand Up @@ -1097,14 +1134,10 @@ def bsquare_split_file(path):
return ("%s/%s" % (project, branch), "/".join(pieces[2:]))


def bsquare_make_factory(svn_url, platform):
def bsquare_make_factory_svn(svn_url, platform):
f = factory.BuildFactory()
f.addStep(SVN(baseURL=svn_url, mode='copy'))

#f.addStep(Compile(name='bootstrap',
# command='buildout bootstrap .',
# description=['bootstrapping'],
# descriptionDone=['bootstrap']))
f.addStep(shell.ShellCommand(
command=[platform.python, r"c:\buildmaster\bootstrap.py"],
haltOnFailure=True,
Expand All @@ -1127,11 +1160,42 @@ def bsquare_make_factory(svn_url, platform):
return f


def bsquare_make_factory_git(git_url, platform):
f = factory.BuildFactory()
f.addStep(Git(
repourl=git_url,
haltOnFailure=True,
mode="copy"))

f.addStep(shell.ShellCommand(
command=[platform.python, r"c:\buildmaster\bootstrap.py"],
haltOnFailure=True,
name="bootstrap",
description="bootstrap"))

f.addStep(shell.ShellCommand(
command=platform.withcompiler % r"bin\buildout.exe",
haltOnFailure=True,
name="buildout",
description="buildout",
timeout=3600))

f.addStep(Test(name="test",
command="bin\\test.exe --exit-with-status -1",
description=['testing'],
descriptionDone=['tests']))

f.treeStableTimer = 300
return f


# XXX:
# XXX: needs a total cleanup!
def bsquare_configure(c,
svn_url, http_port=8010, allowForce=False,
svn_url=None, http_port=8010, allowForce=False,
svnuser=None, svnpasswd=None,
pollinterval=30, nightlyhour=None,
poller=None, makefactory=bsquare_make_factory,
poller=None, makefactory=bsquare_make_factory_svn,
maxConcurrent=2,
svnbin='svn',
slow_lock=None):
Expand Down Expand Up @@ -1161,12 +1225,13 @@ def bsquare_configure(c,
"""
if poller is None:
c['change_source'] = SVNPoller(svn_url,
split_file=bsquare_split_file,
svnuser=svnuser,
svnpasswd=svnpasswd,
pollinterval=pollinterval,
svnbin=svnbin)
if svn_url:
c['change_source'] = SVNPoller(svn_url,
split_file=bsquare_split_file,
svnuser=svnuser,
svnpasswd=svnpasswd,
pollinterval=pollinterval,
svnbin=svnbin)
else:
c['change_source'] = poller

Expand All @@ -1182,13 +1247,23 @@ def bsquare_configure(c,
if not project or project.startswith('#'):
continue # comment or empty line

project, repourl = project.split(',')
project = project.strip()
repourl = repourl.strip()

for bsquare_platname, bsquare_platform in platforms.items():
if isinstance(makefactory, dict):
f = makefactory.get(project,
makefactory.get('__default__', makefactory))
f = f(svn_url, platform=bsquare_platform)
#if isinstance(makefactory, dict):
# f = makefactory.get(project,
# makefactory.get('__default__', makefactory))
# f = f(repourl, platform=bsquare_platform)
#else:
# f = makefactory(repourl, platform=bsquare_platform)
isgit = repourl.lower().startswith('git')
if isgit:
makefactory = bsquare_make_factory_git
else:
f = makefactory(svn_url, platform=bsquare_platform)
makefactory = bsquare_make_factory_svn
f = makefactory(repourl, platform=bsquare_platform)

bname = '%s_%s' % (project, bsquare_platname)

Expand All @@ -1208,9 +1283,13 @@ def bsquare_configure(c,
builderNames=[bname]))

if nightlyhour is not None:
c['schedulers'].append(Nightly(
"%s nightly" % project, [bname], hour=[nightlyhour],
branch="%s/trunk" % project))
if isgit:
c['schedulers'].append(Nightly(
"%s nightly" % project, [bname], hour=[nightlyhour]))
else:
c['schedulers'].append(Nightly(
"%s nightly" % project, [bname], hour=[nightlyhour],
branch="%s/trunk" % project))

c['status'].append(
MailNotifier(mode="failing",
Expand Down Expand Up @@ -1252,7 +1331,6 @@ setup_ZODB_dev_tests(slow_lock, hour=21, minute=50)
setup_BB_dev_tests(slow_lock, hour=21, minute=55)

bsquare_configure(c,
'svn://svn.zope.org/repos/main/',
pollinterval = 300,
nightlyhour=23,
slow_lock = slow_lock,
Expand Down

0 comments on commit 6723a8e

Please sign in to comment.