diff options
author | Parménides GV <parmegv@sdf.org> | 2015-07-30 12:11:31 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2015-07-30 12:11:31 +0200 |
commit | 4b1501ca30e7e490c8c445785bd70f48e7782a07 (patch) | |
tree | 9bbdfdbbe58f2648db5478e2ff88ddd5636fc559 | |
parent | 4cfc07a01538e328ba324f98eef78849147ead30 (diff) | |
parent | dc5e64379e4247fd2d943a247fabca6524af17c2 (diff) |
Merge branch 'feature/7325-add-a-builder-that-builds-and-upload-sumo-tarballs-on-each-bitmask-build'
-rw-r--r-- | master.cfg | 45 |
1 files changed, 29 insertions, 16 deletions
@@ -20,8 +20,8 @@ del d # a BuildSlave object, specifying a unique slave name and password. The same # slave name and password must be configured on the slave. from buildbot.buildslave import BuildSlave -slave_name = "localhost_slave" -c['slaves'] = [BuildSlave(slave_name, PASSWORDS[slave_name])] +localhost_slave = "localhost_slave" +c['slaves'] = [BuildSlave(localhost_slave, PASSWORDS[localhost_slave])] # 'protocols' contains information about protocols which master will use for # communicating with slaves. @@ -39,16 +39,19 @@ c['protocols'] = {'pb': {'port': PORT_MASTER}} # about source code changes. github_repos_username = 'leapcode' -github_repos_beginning = 'https://github.com/' + github_repos_username + '/' default_branch = 'develop' -order_repos_index = 3 +order_repos_index = 2 REPOS=[ - ('leap_pycommon', default_branch, github_repos_beginning + 'leap_pycommon.git', 1, 'leap.common'), - ('soledad', default_branch, github_repos_beginning + 'soledad.git', 2, 'leap.soledad'), - ('keymanager', default_branch, github_repos_beginning + 'keymanager.git', 3, 'leap.keymanager'), - ('leap_mail', default_branch, github_repos_beginning + 'leap_mail.git', 4, 'leap.mail') + ('leap_pycommon', default_branch, 1, 'leap.common'), + ('soledad', default_branch, 2, 'leap.soledad'), + ('keymanager', default_branch, 3, 'leap.keymanager'), + ('leap_mail', default_branch, 4, 'leap.mail'), + ('bitmask_client', default_branch, 5, 'leap.bitmask'), ] +def github_repo_url(repo_name): + return 'https://github.com/' + github_repos_username + '/' + repo_name + '.git' + ####### SCHEDULERS # Configure the Schedulers, which decide how to react to incoming changes. @@ -58,10 +61,10 @@ from buildbot.schedulers.forcesched import ForceScheduler from buildbot.changes.filter import ChangeFilter c['schedulers'] = [] -for repo_name, repo_branch, repo_url, _, _ in REPOS: +for repo_name, repo_branch, _, _ in REPOS: c['schedulers'].append(AnyBranchScheduler( name=repo_name, - change_filter = ChangeFilter(repository=repo_url), + change_filter = ChangeFilter(repository=github_repo_url(repo_name)), builderNames=['builder_' + repo_name])) c['schedulers'].append(ForceScheduler( @@ -79,7 +82,7 @@ from buildbot.steps.source.git import Git from buildbot.steps.shell import ShellCommand from buildbot.config import BuilderConfig -def add_repo_to_factory(factory, repo_name, repo_url, namespace, venv_name): +def add_repo_to_factory(factory, repo_name, git_branch, namespace, venv_name): install_requirements = 'pkg/pip_install_requirements.sh' install_requirements_tests = "if [ -f pkg/requirements-testing.pip ]; then pip install --upgrade -r pkg/requirements-testing.pip; fi" install = "python setup.py develop" @@ -87,11 +90,14 @@ def add_repo_to_factory(factory, repo_name, repo_url, namespace, venv_name): workdir = "workdir-" + repo_name sandbox_path = {'PATH': "../" + venv_name + '/bin/' + ':${PATH}'} sandbox_path_soledad = {'PATH': "../../" + venv_name + '/bin/' + ':${PATH}'} + repo_url = github_repo_url(repo_name) factory.addSteps([ - Git(repourl=repo_url, workdir=workdir, mode='incremental', method='clean', haltOnFailure=True, name="Pull " + repo_url), + Git(repourl=repo_url, branch=git_branch, workdir=workdir, mode='incremental', method='clean', haltOnFailure=True, name="Pull " + repo_url), ShellCommand(command=['pep8', '--exclude=setup.py,versioneer.py,src._version', '--ignore=E501', '.'],env=sandbox_path,haltOnFailure=False, workdir=workdir, name="pep8 on " + repo_name) ]) + if 'bitmask_client' in repo_name: + factory.addStep(ShellCommand(command='pkg/postmkvenv.sh',env=sandbox_path,haltOnFailure=False, workdir=workdir, name="postmkenv")) if 'soledad.git' in repo_url: for subpackage in ["common", "client", "server"]: factory.addSteps([ @@ -121,17 +127,24 @@ def create_builder(repo_name): ]) repo_index = [repo[order_repos_index] for repo in REPOS if repo[0] is repo_name][0] - for repo_name, repo_branch, repo_url, _, namespace, in sorted(REPOS, key = lambda repo: repo[order_repos_index])[0:repo_index]: - add_repo_to_factory(factory, repo_name, repo_url, namespace, venv_name) + for repo_name, repo_branch, _, namespace, in sorted(REPOS, key = lambda repo: repo[order_repos_index])[0:repo_index]: + add_repo_to_factory(factory, repo_name, repo_branch, namespace, venv_name) if namespace is not '': factory.addStep(ShellCommand(command=['trial', namespace], env=venv_path_factory, workdir="workdir-" + repo_name, name="trial "+namespace)) - return BuilderConfig(name=builder_name, slavenames=[slave_name], factory=factory) + if repo_name is 'bitmask_client': + factory.addStep(ShellCommand(command=['make', 'sumo_tarball'], + env=venv_path_factory, workdir="workdir-" + repo_name, + doStepIf=(lambda step: step.getProperty('slavename') == localhost_slave), + name="make sumo tarball")) + + + return BuilderConfig(name=builder_name, slavenames=[localhost_slave], factory=factory) c['builders'] = [] -for repo_name, _, _, _, _ in REPOS: +for repo_name, _, _, _ in REPOS: c['builders'].append(create_builder(repo_name)) ####### STATUS TARGETS |