def fromDict(self, y): buildbot_travis.api.setCfg(y) self.cfgdict = y self.createWorkerConfig() self.importantManager = ImportantManager( y.setdefault("not_important_files", [])) self.defaultEnv = y.setdefault("env", {}) for k, v in self.defaultEnv.items(): if not (isinstance(v, list) or isinstance(v, basestring)): config_error( "'env' values must be strings or lists ; key %s is incorrect: %s" % (k, type(v))) for p in y.setdefault("projects", []): self.define_travis_builder(**p) self.defaultStages = y.setdefault("stages", []) for s in self.defaultStages: if not isinstance(s, basestring): config_error( "'stages' values must be strings ; stage %s is incorrect: %s" % (s, type(s))) PORT = int(os.environ.get('PORT', 8010)) self.config['buildbotURL'] = os.environ.get( 'buildbotURL', "http://localhost:%d/" % (PORT, )) db_url = os.environ.get('BUILDBOT_DB_URL') if db_url is not None: self.config.setdefault('db', {'db_url': db_url}) # minimalistic config to activate new web UI self.config['www'] = dict(port=PORT, change_hook_dialects=self.change_hook_dialects, plugins=dict(buildbot_travis={ 'supported_vcs': getSupportedVCSTypes()}), versions=[('buildbot_travis', getVersion(__file__))]) self.config.setdefault('protocols', {'pb': {'port': 9989}}) self.createAuthConfig()
def fromDict(self, y): buildbot_travis.api.setCfg(y) self.cfgdict = y self.importantManager = ImportantManager( y.get("not_important_files", [])) self.defaultEnv = y.get("env", {}) for k, v in self.defaultEnv.items(): if not (isinstance(v, list) or isinstance(v, basestring)): config_error( "'env' values must be strings or lists ; key %s is incorrect: %s" % (k, type(v))) for p in y.get("projects", []): self.define_travis_builder(**p) self.defaultStages = y.get("stages", []) for s in self.defaultStages: if not isinstance(s, basestring): config_error( "'stages' values must be strings ; stage %s is incorrect: %s" % (s, type(s))) PORT = int(os.environ.get('PORT', 8020)) self.config['buildbotURL'] = os.environ.get( 'buildbotURL', "http://localhost:%d/" % (PORT, )) # minimalistic config to activate new web UI self.config['www'] = dict( port=PORT, change_hook_dialects=self.change_hook_dialects, plugins=dict(buildbot_travis={ 'cfg': self.cfgdict, 'supported_vcs': getSupportedVCSTypes() }), versions=[('buildbot_travis', getVersion(__file__))])
def fromDict(self, y): buildbot_travis.api.setCfg(y) self.cfgdict = y self.createWorkerConfig() self.importantManager = ImportantManager( y.setdefault("not_important_files", [])) self.defaultEnv = y.setdefault("env", {}) for k, v in self.defaultEnv.items(): if not (isinstance(v, list) or isinstance(v, string_types)): config_error( "'env' values must be strings or lists ; key %s is incorrect: %s" % (k, type(v))) for p in y.setdefault("projects", []): self.define_travis_builder(**p) self.defaultStages = y.setdefault("stages", []) for s in self.defaultStages: if not isinstance(s, string_types): config_error( "'stages' values must be strings ; stage %s is incorrect: %s" % (s, type(s))) PORT = int(os.environ.get('PORT', 8010)) self.config['buildbotURL'] = os.environ.get( 'buildbotURL', "http://localhost:%d/" % (PORT, )) db_url = os.environ.get('BUILDBOT_DB_URL') if db_url is not None: self.config.setdefault('db', {'db_url': db_url}) # minimalistic config to activate new web UI self.config['www'] = dict( port=PORT, change_hook_dialects=self.change_hook_dialects, plugins=dict(buildbot_travis={ 'supported_vcs': getSupportedVCSTypes(), 'cfg': self.getCleanConfig() }, console_view=True, waterfall_view=True), versions=[('buildbot_travis', getVersion(__file__))]) # automatically enable installed plugins apps = get_plugins('www', None, load_now=True) for plugin_name in set(apps.names): if plugin_name not in ( 'base', 'wsgi_dashboards' ) and plugin_name not in self.config['www']['plugins']: self.config['www']['plugins'][plugin_name] = True self.config['www']['versions'].append(apps.info(plugin_name)) self.config.setdefault('protocols', {'pb': {'port': 9989}}) self.createAuthConfig()
def fromDict(self, y): buildbot_travis.api.setCfg(y) self.cfgdict = y self.createWorkerConfig() self.importantManager = ImportantManager( y.setdefault("not_important_files", [])) self.defaultEnv = y.setdefault("env", {}) for k, v in self.defaultEnv.items(): if not (isinstance(v, list) or isinstance(v, string_types)): config_error( "'env' values must be strings or lists ; key %s is incorrect: %s" % (k, type(v))) for p in y.setdefault("projects", []): self.define_travis_builder(**p) self.defaultStages = y.setdefault("stages", []) for s in self.defaultStages: if not isinstance(s, string_types): config_error( "'stages' values must be strings ; stage %s is incorrect: %s" % (s, type(s))) PORT = int(os.environ.get('PORT', 8010)) self.config['buildbotURL'] = os.environ.get( 'buildbotURL', "http://localhost:%d/" % (PORT, )) db_url = os.environ.get('BUILDBOT_DB_URL') if db_url is not None: self.config.setdefault('db', {'db_url': db_url}) # minimalistic config to activate new web UI self.config['www'] = dict( port=PORT, change_hook_dialects=self.change_hook_dialects, plugins=dict( buildbot_travis={ 'supported_vcs': getSupportedVCSTypes(), 'cfg': self.getCleanConfig() }), versions=[('buildbot_travis', getVersion(__file__))]) self.config.setdefault('protocols', {'pb': {'port': 9989}}) self.createAuthConfig()