blob: 703c10e1be4c0f308ef39adcf0f4a62b7b427f29 [file] [log] [blame]
import json
import os
import sys
from buildbot.changes.pb import PBChangeSource
from buildbot.plugins import util
from datetime import timedelta
from loadConfig import *
# This is work-around for https://bugs.webkit.org/show_bug.cgi?id=222361
from buildbot.process.buildstep import BuildStep
BuildStep.warn_deprecated_if_oldstyle_subclass = lambda self, name: None
is_test_mode_enabled = os.getenv('BUILDBOT_PRODUCTION') is None
c = BuildmasterConfig = {}
c['change_source'] = PBChangeSource(port=16000)
# permissions for WebStatus
c['www'] = dict(port='tcp:8710:interface=127.0.0.1', plugins=dict(waterfall_view={}, console_view={}, grid_view={}), allowed_origins=["*"])
c['www']['ui_default_config'] = {
'Builders.show_workers_name': True,
'Builders.buildFetchLimit': 1000,
'Workers.showWorkerBuilders': True,
}
if not is_test_mode_enabled:
passwords = json.load(open('passwords.json'))
admin_username = passwords.get('ADMIN_USERNAME')
admin_password = passwords.get('ADMIN_PASSWORD')
if not admin_username or not admin_password:
print('\n\nERROR: Admin username/password missing from passwords.json.\n')
sys.exit(1)
# See https://docs.buildbot.net/2.10.0/manual/configuration/www.html#example-configs
authz = util.Authz(
allowRules=[util.AnyControlEndpointMatcher(role="admin")],
roleMatchers=[util.RolesFromEmails(admin=[admin_username])]
)
auth = util.UserPasswordAuth({admin_username: admin_password})
c['www']['auth'] = auth
c['www']['authz'] = authz
c['protocols'] = {'pb': {'port': 17000}}
c['projectName'] = 'WebKit'
c['projectURL'] = 'https://webkit.org'
if is_test_mode_enabled:
c['buildbotURL'] = 'http://localhost:8710/'
else:
c['buildbotURL'] = 'https://build.webkit.org/'
passwords = json.load(open('passwords.json'))
db_url = passwords.get('DB_URL')
db_name = passwords.get('DB_NAME')
db_username = passwords.get('DB_USERNAME')
db_password = passwords.get('DB_PASSWORD')
if None in [db_url, db_name, db_username, db_password]:
print('\n\nERROR: Database information missing from passwords.json.\n')
sys.exit(1)
# See https://docs.buildbot.net/2.10.0/manual/configuration/global.html#database-specification
c['db_url'] = 'postgresql://{}:{}@{}/{}'.format(db_username, db_password, db_url, db_name)
# configure a janitor to delete old logs
c['configurators'] = [util.JanitorConfigurator(logHorizon=timedelta(weeks=26), hour='1', dayOfWeek='*')]
c['buildCacheSize'] = 60
c['logCompressionMethod'] = 'lz4'
c['buildbotNetUsageData'] = None
loadBuilderConfig(c, is_test_mode_enabled=is_test_mode_enabled)