| OLD | NEW |
| (Empty) | |
| 1 # -*- python -*- |
| 2 # ex: set syntax=python: |
| 3 |
| 4 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 5 # Use of this source code is governed by a BSD-style license that can be |
| 6 # found in the LICENSE file. |
| 7 |
| 8 import config |
| 9 import master_site_config |
| 10 |
| 11 from buildbot.changes.filter import ChangeFilter |
| 12 from buildbot.process.properties import WithProperties |
| 13 from buildbot.schedulers.basic import AnyBranchScheduler |
| 14 from buildbot.status import mail |
| 15 |
| 16 from master import gitiles_poller |
| 17 from master import master_utils |
| 18 from master import slaves_list |
| 19 from master.factory import annotator_factory |
| 20 from master.factory import remote_run_factory |
| 21 |
| 22 |
| 23 ActiveMaster = master_site_config.InfraCodesearch |
| 24 |
| 25 c = BuildmasterConfig = {} |
| 26 c['slavePortnum'] = ActiveMaster.slave_port |
| 27 c['schedulers'] = [] |
| 28 c['builders'] = [] |
| 29 c['change_source'] = [] |
| 30 c['status'] = [] |
| 31 |
| 32 f_annotations = annotator_factory.AnnotatorFactory(ActiveMaster) |
| 33 |
| 34 def m_remote_run(recipe, **kwargs): |
| 35 props = {'path_config': 'kitchen'} |
| 36 props.update(kwargs.pop('properties', {})) |
| 37 return remote_run_factory.RemoteRunFactory( |
| 38 active_master=ActiveMaster, |
| 39 repository=kwargs.pop( |
| 40 'repository', 'https://chromium.googlesource.com/infra/infra.git'), |
| 41 recipe=recipe, |
| 42 factory_properties=props, |
| 43 **kwargs) |
| 44 |
| 45 revision_getter = master_utils.ConditionalProperty( |
| 46 lambda build: build.getProperty('revision'), |
| 47 WithProperties('%(revision)s'), |
| 48 'origin/master') |
| 49 |
| 50 ####### DATABASE |
| 51 |
| 52 config.DatabaseSetup(c) |
| 53 |
| 54 ####### CHANGE SOURCES |
| 55 |
| 56 INFRA_REPO_URL = 'https://chromium.googlesource.com/infra/infra' |
| 57 TOOLS_BUILD_URL = 'https://chromium.googlesource.com/chromium/tools/build' |
| 58 CHROMIUM_REPO_URL = 'https://chromium.googlesource.com/chromium/src' |
| 59 |
| 60 c['change_source'].extend([ |
| 61 gitiles_poller.GitilesPoller(INFRA_REPO_URL), |
| 62 gitiles_poller.GitilesPoller(CHROMIUM_REPO_URL), |
| 63 gitiles_poller.GitilesPoller(TOOLS_BUILD_URL), |
| 64 ]) |
| 65 |
| 66 ####### BUILDERS |
| 67 |
| 68 c['builders'].extend([ |
| 69 { |
| 70 'name': 'codesearch-submodules-chromium', |
| 71 'factory': m_remote_run( |
| 72 'sync_submodules', repository=INFRA_REPO_URL, |
| 73 properties={'source_repo': CHROMIUM_REPO_URL}), |
| 74 'category': 'codesearch-submodules', |
| 75 }, |
| 76 { |
| 77 'name': 'codesearch-submodules-infra', |
| 78 'factory': m_remote_run( |
| 79 'sync_submodules', repository=INFRA_REPO_URL, |
| 80 properties={'source_repo': INFRA_REPO_URL}), |
| 81 'category': 'codesearch-submodules', |
| 82 }, |
| 83 { |
| 84 'name': 'codesearch-submodules-build', |
| 85 'factory': m_remote_run( |
| 86 'sync_submodules', repository=INFRA_REPO_URL, |
| 87 properties={'source_repo': TOOLS_BUILD_URL}), |
| 88 'category': 'codesearch-submodules', |
| 89 }, |
| 90 ]) |
| 91 |
| 92 ####### SCHEDULERS |
| 93 |
| 94 c['schedulers'].extend([ |
| 95 AnyBranchScheduler( |
| 96 name='infra-scheduler', |
| 97 change_filter=ChangeFilter(project=['infra']), |
| 98 treeStableTimer=30, |
| 99 builderNames=[ |
| 100 'codesearch-submodules-infra', |
| 101 ] |
| 102 ), |
| 103 AnyBranchScheduler( |
| 104 name='chromium-scheduler', |
| 105 change_filter=ChangeFilter(project=['src']), |
| 106 treeStableTimer=1, |
| 107 builderNames=[ |
| 108 'codesearch-submodules-chromium', |
| 109 ] |
| 110 ), |
| 111 AnyBranchScheduler( |
| 112 name='build-scheduler', |
| 113 change_filter=ChangeFilter(project=['build']), |
| 114 treeStableTimer=1, |
| 115 builderNames=[ |
| 116 'codesearch-submodules-build', |
| 117 ] |
| 118 ), |
| 119 ]) |
| 120 |
| 121 ####### BUILDSLAVES |
| 122 |
| 123 # Associate the slaves to the builders. The configuration is in slaves.cfg. |
| 124 slaves = slaves_list.SlavesList('slaves.cfg', 'InfraCodesearch') |
| 125 for builder in c['builders']: |
| 126 builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) |
| 127 |
| 128 # The 'slaves' list defines the set of allowable buildslaves. List all the |
| 129 # slaves registered to a builder. Remove dupes. |
| 130 c['slaves'] = master_utils.AutoSetupSlaves( |
| 131 c['builders'], config.Master.GetBotPassword()) |
| 132 |
| 133 # Make sure everything works together. |
| 134 master_utils.VerifySetup(c, slaves) |
| 135 |
| 136 ####### STATUS TARGETS |
| 137 |
| 138 # Adds common status and tools (web status, mail notifier) to this master. |
| 139 master_utils.AutoSetupMaster( |
| 140 c, ActiveMaster, mail_notifier=False, order_console_by_time=True, |
| 141 public_html='./public_html', |
| 142 templates=['./templates', '../master.chromium/templates'] |
| 143 ) |
| 144 |
| 145 ####### PROJECT IDENTITY |
| 146 |
| 147 c['projectName'] = ActiveMaster.project_name |
| 148 c['buildbotURL'] = ActiveMaster.buildbot_url |
| OLD | NEW |