Skip to content

Latest commit

 

History

History
46 lines (29 loc) · 1.58 KB

dbconfig.rst

File metadata and controls

46 lines (29 loc) · 1.58 KB

DbConfig

DbConfig is a utility for master.cfg to get easy-to-use key-value storage in the Buildbot database.

DbConfig can get and store any json-able object to the db for use by other masters or separate UI plugins to edit them.

The design is intentionally simplistic, as the focus is on ease of use rather than efficiency. A separate db connection is created each time get() or set() is called.

Example:

from buildbot.plugins import util, worker

c = BuildmasterConfig = {}
c['db_url'] = 'mysql://username:password@mysqlserver/buildbot'
dbConfig = util.DbConfig(BuildmasterConfig, basedir)
workers = dbConfig.get("workers")
c['workers'] = [
    worker.Worker(worker['name'], worker['passwd'],
                  properties=worker.get('properties')),
    for worker in workers
]