From 9b56c189e0bfbef8dedc6c6591a4311f0e5a50db Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 10 Dec 2013 12:06:50 -0400 Subject: properly setup multiproject. This fixes a previous bad setup in which one change would trigger all builders. --- master.cfg | 134 +++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 91 insertions(+), 43 deletions(-) diff --git a/master.cfg b/master.cfg index 3abed40..ed13482 100644 --- a/master.cfg +++ b/master.cfg @@ -56,17 +56,37 @@ def run_cmd(cmd, cwd=None): #run_cmd(rm_cmd) #branches = ['develop'] + gitflow -# XXX For NOW, only develop branches -branches = ['develop'] from buildbot.changes.gitpoller import GitPoller from buildbot.changes import pb +REPO_BASE = "https://leap.se/git/" + +# Tuples in the form: (repo_uri, repo_name) +REPOS = (("bitmask_client", "bitmask"), + ("soledad", "soledad"), + ("leap_mail", "mail"), + ("keymanager", "keymanager")) + +# This is only for having all builders having +# a scheduler by now. Eventually, replace +# REPOS with this one. + +REPOS_ALL = (("bitmask_client", "bitmask"), + ("soledad", "soledad"), + ("leap_mail", "mail"), + ("keymanager", "keymanager"), + ("leap_mx", "mx"), + ("leap_pycommon", "common")) +branches = ['develop', 'master'] + c['change_source'] = [] -# XXX how to make the pollers affect to each matching builder? -c['change_source'].append(GitPoller( - 'git://leap.se/bitmask_client', - workdir="gitpoller-workdir", branches=branches, pollinterval=300)) +for repo, proj_name in REPOS: + c['change_source'].append(GitPoller( + REPO_BASE + repo, + workdir="gitpoller-workdir-"+repo, + project=proj_name, + branches=branches, pollinterval=300)) #git poll branch names to automatically build branches to watch. @@ -81,34 +101,39 @@ from buildbot.schedulers.timed import Nightly from buildbot.changes import filter c['schedulers'] = [] -# XXX this was a good idea, we should bring it to life again... -#c['schedulers'].append(ForceScheduler( -# name="force", -# builderNames=["linux-incremental", -# ])) - -for branch in branches: - c['schedulers'].append(SingleBranchScheduler( - name=branch + "-checkin", - change_filter=filter.ChangeFilter(branch=branch), - treeStableTimer=60, - builderNames=[ - "bitmask-linux-quick", - ])) - -c['schedulers'].append(Nightly( - name="develop-nightly", - branch="develop", - hour=4, - minute=23, - onlyIfChanged=True, - builderNames=["bitmask-linux-quick", - "mail-linux-quick", - "keymanager-linux-quick", - "mx-linux-quick", - "common-linux-quick", - "soledad-linux-quick" - ])) + +# BRANCH SCHEDULER (each time a commit is done) +# for develop and master branch, for all *active* +# repos +# --------------------------------------------- + +for _, proj_name in REPOS: + for branch in branches: + c['schedulers'].append( + SingleBranchScheduler( + name="%s-%-s-checkin" % (proj_name, branch), + change_filter=filter.ChangeFilter( + branch=branch, + project=proj_name), + treeStableTimer=60, + builderNames=[ + "%s-linux-quick" % proj_name, + ])) + +# NIGHTLY SCHEDULER -- daily. +# We should change to a new builder that +# triggers an autobuild. +# --------------------------------------------- + +for _, proj_name in REPOS_ALL: + c['schedulers'].append(Nightly( + name="%s-develop-nightly" % proj_name, + branch="develop", + hour=16, + minute=30, + onlyIfChanged=True, + builderNames=["%s-linux-quick" % proj_name] + )) ####### BUILDERS @@ -166,21 +191,22 @@ install_virt = ShellCommand(name='Installing Virtual Environment', description='Installing Virtual Environment', command=['cp', '-r', '/home/buildslave/venv/.venv', '.']) -install_leap = ShellCommand(name='install leap into virtualenv', - description='yet another workaround for namespace package weirdness', - command=['pkg/tools/with_venv.sh', 'python', 'setup.py', 'install']) - make_resources = ShellCommand(name='compile qt resources', - description='generates locales and ui files', + description='make ui ...', command=['make']) run_tests = ShellCommand(name='Running Tests', description='Running tests', command=['pkg/tools/with_venv.sh', './run_tests.sh', '--coverage']) develop_mode = ShellCommand(name='run in develop mode', - description='yet another workaround for namespace package weirdness', + description='setup develop', command=['pkg/tools/with_venvwrapper.sh', 'leap-bitmask', 'python', 'setup.py', 'develop']) +develop_mode_soledad = ShellCommand(name='develop mode (soledad)', + description='setup develop', + command=['common/pkg/tools/with_venvwrapper.sh', 'leap-bitmask', './scripts/develop_mode.sh']) + + run_tests_venv = ShellCommand( name='Running Tests (venv)', description="Running tests in a virtualenv via virtualenvwrapper", @@ -196,6 +222,11 @@ run_tests_py = ShellCommand( description="Running tests in a virtualenv via virtualenvwrapper", command=['pkg/tools/with_venvwrapper.sh', 'leap-bitmask', 'python', 'setup.py', 'test']) +run_tests_py_soledad = ShellCommand( + name='Running Tests (venv)', + description="Running tests in a virtualenv via virtualenvwrapper", + command=['common/pkg/tools/with_venvwrapper.sh', 'leap-bitmask', './run_tests.sh']) + run_tox = ShellCommand(name='Running tox', description='Running tox', command=['pkg/tools/with_venv.sh', 'tox', '-v']) @@ -205,6 +236,11 @@ run_pep8 = ShellCommand(name='Running pep8', description='Running pep8', '--ignore=E202,W602 --exclude=ui_*,*_rc.py,_version.py --repeat', 'src/leap']) +run_pep8_soledad = ShellCommand(name='Running pep8', description='Running pep8', + command=['common/pkg/tools/with_venvwrapper.sh', 'leap-bitmask', 'pep8', + '--ignore=E202,W602 --exclude=ui_*,*_rc.py,_version.py --repeat', + 'common/src/leap']) + run_coverage = ShellCommand(name='Running coverage', description='Running coverage', command=['pkg/tools/with_venv.sh', 'coverage', 'html', '-d', 'docs/covhtml', '-i', '--include=src/leap/*', @@ -250,14 +286,26 @@ def get_quick_builder(repo_name): if client: steps.append(make_resources) - steps = steps + [ - develop_mode, - run_pep8] + if soledad: + steps = steps + [ + develop_mode_soledad] + else: + steps = steps + [ + develop_mode] + + # run pep8 + if soledad: + steps = steps + [run_pep8_soledad] + else: + steps = steps + [run_pep8] + # run tests if client: steps = steps + [ run_tests_venv, UploadCoverage(name='Uploading coverage', description='Uploading coverage')] + elif soledad: + steps = steps + [run_tests_py_soledad] else: # any other steps = steps + [run_tests_py] -- cgit v1.2.3