# -*- python -*- # ex: set syntax=python: import textwrap import ConfigParser config = ConfigParser.ConfigParser() config.read('conf.cfg') # This is the dictionary that the buildmaster pays attention to. We also use # a shorter alias to save typing. c = BuildmasterConfig = {} ####### BUILDSLAVES # The 'slaves' list defines the set of recognized buildslaves. Each element is # a BuildSlave object, specifying a unique slave name and password. The same # slave name and password must be configured on the slave. import slaves reload(slaves) c['slaves'] = slaves.slaves # 'protocols' contains information about protocols which master will use for # communicating with slaves. # You must define at least 'port' option that slaves could connect to your master # with this protocol. # 'port' must match the value configured into the buildslaves (with their # --master option) PORT_WEB = 8010 # Buildbot webserver port PORT_MASTER = 9989 # Port where buildbot master listen buildworkers c['protocols'] = {'pb': {'port': PORT_MASTER}} ####### CHANGESOURCES # the 'change_source' setting tells the buildmaster how it should find out # about source code changes. default_branch = 'develop' # XXX: leap_mx doesn't need bitmask_client or leap_mail, not sure if two # pipelines here are worth it REPOS=[ ('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'), ('leap_mx', default_branch, 6, 'leap.mx'), ] from util import github_repo_url, order_repos_index all_repositories = { r'https://github.com/leapcode/leap_pycommon.git': 'leap_pycommon', r'https://github.com/leapcode/soledad.git': 'soledad', r'https://github.com/leapcode/keymanager.git': 'keymanager', r'https://github.com/leapcode/leap_mail.git': 'leap_mail', r'https://github.com/leapcode/bitmask_client.git': 'bitmask_client', r'https://github.com/leapcode/leap_mx.git': 'leap_mx', } def codebaseGenerator(chdict): return all_repositories[chdict['repository']] c['codebaseGenerator'] = codebaseGenerator from buildbot.plugins import changes poll_interval_minutes = 5 c['change_source'] = [changes.GitPoller(repourl=github_repo_url(repo_name), branches=[repo_branch], workdir=repo_name, pollInterval=poll_interval_minutes * 60) for repo_name, repo_branch, _, _ in REPOS] ####### SCHEDULERS # Configure the Schedulers, which decide how to react to incoming changes. from buildbot.schedulers.basic import AnyBranchScheduler from buildbot.schedulers.forcesched import ForceScheduler, CodebaseParameter from buildbot.changes.filter import ChangeFilter from buildbot.plugins import schedulers c['schedulers'] = [] def all_codebases(repo_name): codebases = {} repo_index = [repo[order_repos_index] for repo in REPOS if repo[0] is repo_name][0] for repo_name, repo_branch, _, namespace, in sorted(REPOS, key = lambda repo: repo[order_repos_index])[0:repo_index]: codebases[repo_name] = { 'repository' : github_repo_url(repo_name), 'branch' : None, 'revision' : None } return codebases def all_codebases_names(repo_name): codebases = [] repo_index = [repo[order_repos_index] for repo in REPOS if repo[0] is repo_name][0] for codebase_repo_name, codebase_repo_branch, _, _, in sorted(REPOS, key = lambda repo: repo[order_repos_index])[0:repo_index]: codebases.append(CodebaseParameter(codebase=codebase_repo_name, branch=codebase_repo_branch, repository=github_repo_url(codebase_repo_name))) return codebases for repo_name, repo_branch, order_, _ in REPOS: c['schedulers'].append(AnyBranchScheduler( name=repo_name, change_filter = ChangeFilter(codebase=repo_name), codebases = all_codebases(repo_name), treeStableTimer = 60, builderNames=['builder_' + repo_name])) c['schedulers'].append(ForceScheduler( name="force_build_of_" + repo_name, codebases = all_codebases_names(repo_name), builderNames=['builder_' + repo_name])) c['schedulers'].append(ForceScheduler( name="force_build_of_wheels", builderNames=['builder_wheels'])) c['schedulers'].append(ForceScheduler( name="force_build_of_bundler", builderNames=['builder_bundler'])) c['schedulers'].append( schedulers.Nightly(name='nightly_bundle', branch=None, builderNames=['builder_bundler'], hour=0, minute=0)) c['schedulers'].append( schedulers.Nightly(name='nightly_bitmask_client', branch=None, builderNames=['builder_bitmask_client'], hour=23, minute=55)) ####### BUILDERS # The 'builders' list defines the Builders, which tell Buildbot how to perform a build: # what steps, and which slaves can execute them. Note that any particular build will # only take place on one slave. from builders import Builders builders = Builders(config, slaves, REPOS) c['builders'] = [] for repo_name, _, _, _ in REPOS: c['builders'].append(builders.create_builder(repo_name)) c['builders'].append(builders.make_wheel_builder()) c['builders'].append(builders.make_bundler_builder()) ####### STATUS TARGETS # 'status' is a list of Status Targets. The results of each build will be # pushed to these targets. buildbot/status/*.py has a variety to choose from, # including web pages, email senders, and IRC bots. c['status'] = [] webinterface_username = "web_interface" c['www'] = dict(port=PORT_WEB, plugins=dict(waterfall_view={}, console_view={}), change_hook_dialects={'github': { }}) ####### PROJECT IDENTITY # the 'title' string will appear at the top of this buildbot # installation's html.WebStatus home page (linked to the # 'titleURL') and is embedded in the title of the waterfall HTML page. c['title'] = config.get('Buildbot', 'title') c['titleURL'] = "https://github.com/leapcode/bitmask_client" # the 'buildbotURL' string should point to the location where the buildbot's # internal web server (usually the html.WebStatus page) is visible. This # typically uses the port number set in the Waterfall 'status' entry, but # with an externally-visible host name which the buildbot cannot figure out # without some help. c['buildbotURL'] = config.get('Buildbot', 'url') ####### DB URL c['db'] = { # This specifies what database buildbot uses to store its state. You can leave # this at its default for all but the largest installations. 'db_url' : "sqlite:///state.sqlite", }