# -*- python -*- # ex: set filetype=python: from buildbot.plugins import util, secrets from buildbot_gentoo_ci.config import schedulers, workers, builders, service, change_source, reporters #FIXME: Should have uuid worker_data_local = [ {'name' : 'updatedb_1', 'type' : 'local', 'enable' : True, }, {'name' : 'updatedb_2', 'type' : 'local', 'enable' : True, }, {'name' : 'updatedb_3', 'type' : 'local', 'enable' : True, }, {'name' : 'updatedb_4', 'type' : 'local', 'enable' : True, }, ] #FIXME: Get workers from db worker_data_docker = [ {'uuid' : 'b89c2c1a-46e0-4ded-81dd-c51afeb7fcfa', 'type' : 'log', 'enable' : True, }, {'uuid' : 'b89c2c1a-46e0-4ded-81dd-c51afeb7fcfb', 'type' : 'log', 'enable' : True, }, {'uuid' : 'b89c2c1a-46e0-4ded-81dd-c51afeb7fcfc', 'type' : 'log', 'enable' : True, }, {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfa', 'type' : 'build', 'enable' : True, }, {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfb', 'type' : 'build', 'enable' : True, }, {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfc', 'type' : 'build', 'enable' : True, }, {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfd', 'type' : 'build', 'enable' : True, }, ] worker_data_node = [ {'uuid' : 'c89c2c1a-46e0-4ded-81dd-c51afeb7fcfa', 'type' : 'node', 'enable' : True, 'password' : util.Secret("Node.c89c2c1a-46e0-4ded-81dd-c51afeb7fcfa")}, ] worker_data = { 'local' : worker_data_local, 'docker' : worker_data_docker, 'node' : worker_data_node, } # This is the dictionary that the buildmaster pays attention to. We also use # a shorter alias to save typing. c = BuildmasterConfig = {} c['buildbotNetUsageData'] = None ####### SECRETS c['secretsProviders'] = [] c['secretsProviders'].append(secrets.SecretInAFile(dirname="/var/lib/buildmaster/gentoo-ci-cloud/secrets")) ####### WORKERS # The 'workers' list defines the set of recognized workers. Each element is # a Worker object, specifying a unique worker name and password. The same # worker name and password must be configured on the worker. c['workers'] = workers.gentoo_workers(worker_data) # 'protocols' contains information about protocols which master will use for # communicating with workers. You must define at least 'port' option that workers # could connect to your master with this protocol. # 'port' must match the value configured into the workers (with their # --master option) c['protocols'] = {'pb': {'port': 9989}} ####### CHANGESOURCES # the 'change_source' setting tells the buildmaster how it should find out # about source code changes. Here we point to the buildbot version of a python hello-world project. #c['change_source'] = change_source.gentoo_change_source() ####### SCHEDULERS # Configure the Schedulers, which decide how to react to incoming changes. In this # case, just kick off a 'runtests' build c['schedulers'] = schedulers.gentoo_schedulers() ####### BUILDERS # The 'builders' list defines the Builders, which tell Buildbot how to perform a build: # what steps, and which workers can execute them. Note that any particular build will # only take place on one worker. c['builders'] = builders.gentoo_builders(worker_data) ####### BUILDBOT SERVICES # 'services' is a list of BuildbotService items like reporter targets. The # status of each build will be pushed to these targets. buildbot/reporters/*.py # has a variety to choose from, like IRC bots. c['services'] = [] c['services'].append(service.GentooCiService(basedir)) c['services'] = reporters.gentoo_reporters(r=c['services']) ####### PROJECT IDENTITY # the 'title' string will appear at the top of this buildbot installation's # home pages (linked to the 'titleURL'). c['title'] = "Gentoo CI" c['titleURL'] = "https://ci.dev.gentoo.org" # the 'buildbotURL' string should point to the location where the buildbot's # internal web server is visible. This typically uses the port number set in # the 'www' entry below, but with an externally-visible host name which the # buildbot cannot figure out without some help. c['buildbotURL'] = "http://0.0.0.0:8010/" # minimalistic config to activate new web UI c['www'] = dict( port=8010, plugins=dict(waterfall_view={}, console_view={}, grid_view={}), change_hook_dialects={ 'gitlab' : { 'secret': util.Secret("WWWHookGitlabToken"), 'token': util.Secret("gitlabToken"), 'baseUrl': 'https://gitlab.gentoo.org', }, }, ) c['www']['ui_default_config'] = { 'Waterfall.lazy_limit_waterfall': 408, 'Console.buildLimit': 1000, 'Console.changeLimit': 150, 'Grid.revisionLimit': 30, 'BuildRequests.buildrequestFetchLimit': 100, 'ChangeBuilds.buildsFetchLimit': 150, 'Changes.changesFetchLimit': 150, } ####### DB URL # This specifies what database buildbot uses to store its state. # It's easy to start with sqlite, but it's recommended to switch to a dedicated # database, such as PostgreSQL or MySQL, for use in production environments. # http://docs.buildbot.net/current/manual/configuration/global.html#database-specification c['db_url'] = "postgresql://buildbot:X@192.0.0.0/buildbot"