d6a89d37c985ff4d6ca94c01872510f26f747616
[WebKit-https.git] / Tools / BuildSlaveSupport / ews-build / master.cfg
1 import os
2 import socket
3
4 import loadConfig
5 from events import Events
6
7 is_test_mode_enabled = os.getenv('BUILDBOT_PRODUCTION') is None
8
9 c = BuildmasterConfig = {}
10
11 c['www'] = dict(port=8010)
12
13 c['www']['ui_default_config'] = { 
14     'Builders.show_workers_name': True,
15     'Builders.buildFetchLimit': 1000,
16     'Workers.showWorkerBuilders': True,
17 }
18
19 c['protocols'] = {'pb': {'port': 17000}}
20
21 c['projectName'] = 'WebKit EWS'
22 c['projectURL'] = 'https://ews-build.webkit.org/'
23
24 if is_test_mode_enabled:
25     c['buildbotURL'] = 'http://localhost:8010/'
26     c['db_url'] = 'sqlite:///state.sqlite?serialize_access=1'
27 else:
28     c['buildbotURL'] = 'https://ews-build.webkit.org/'
29     db_url = os.getenv('DB_URL', None)
30     db_name = os.getenv('DB_NAME', None)
31     db_username = os.getenv('DB_USERNAME', None)
32     db_password = os.getenv('DB_PASSWORD', None)
33     if None in [db_url, db_name, db_username, db_password]:
34         print('Environment variables for DB not found. Please ensure these variables are set.')
35         sys.exit(1)
36     # See https://docs.buildbot.net/1.7.0/manual/configuration/global.html#database-specification
37     c['db_url'] = 'postgresql://{}:{}@{}/{}'.format(db_username, db_password, db_url, db_name)
38
39 c['logCompressionMethod'] = 'lz4'
40 c['buildbotNetUsageData'] = None
41
42 loadConfig.loadBuilderConfig(c, is_test_mode_enabled=is_test_mode_enabled)
43
44 if not is_test_mode_enabled:
45     hostname =  socket.gethostname().strip()
46     event_reporter = Events(master_hostname=hostname, type_prefix='ews')
47     c['services'] = [event_reporter]