| # -*- python -*- |
| # ex: set syntax=python: |
| |
| # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| from buildbot.scheduler import Scheduler |
| from buildbot.schedulers import timed |
| from buildbot.status import mail |
| |
| from common import chromium_utils |
| |
| from master import gitiles_poller |
| from master import master_utils |
| from master import slaves_list |
| from master.factory import annotator_factory |
| |
| import config |
| import master_site_config |
| |
| ActiveMaster = master_site_config.ChromiumSwarm |
| |
| # This is the dictionary that the buildmaster pays attention to. We also use |
| # a shorter alias to save typing. |
| c = BuildmasterConfig = {} |
| |
| # 'slavePortnum' defines the TCP port to listen on. This must match the value |
| # configured into the buildslaves (with their --master option) |
| c['slavePortnum'] = ActiveMaster.slave_port |
| |
| config.DatabaseSetup(c) |
| |
| ####### CHANGESOURCES |
| |
| # Polls config.Master.trunk_url for changes |
| master_poller = gitiles_poller.GitilesPoller( |
| 'https://chromium.googlesource.com/chromium/src') |
| |
| c['change_source'] = [master_poller] |
| |
| ####### SCHEDULERS |
| |
| s_chromium_swarm = Scheduler(name='experimental', |
| branch='master', |
| treeStableTimer=60, |
| builderNames=['Linux Swarm', |
| 'Android Swarm', |
| 'Mac Swarm']) |
| |
| s_heartbeat = timed.Periodic( |
| name='heartbeat', builderNames=['Heartbeat', 'Heartbeat Canary'], |
| periodicBuildTimer=60) |
| |
| c['schedulers'] = [s_chromium_swarm, s_heartbeat] |
| |
| |
| # ---------------------------------------------------------------------------- |
| # BUILDER DEFINITIONS |
| |
| def Recipe(config): |
| return annotator_factory.AnnotatorFactory().BaseFactory( |
| 'swarming/staging', factory_properties={'configuration': config}) |
| |
| b_heartbeat = { |
| 'name': 'Heartbeat', |
| 'builddir': 'heartbeat', |
| 'factory': annotator_factory.AnnotatorFactory().BaseFactory( |
| 'swarming/heartbeat'), |
| 'auto_reboot': False, |
| 'category': 'swarming', |
| } |
| |
| b_heartbeat_staging = { |
| 'name': 'Heartbeat Canary', |
| 'builddir': 'heartbeat_staging', |
| 'factory': annotator_factory.AnnotatorFactory().BaseFactory( |
| 'swarming/heartbeat', |
| factory_properties={'target_environment': 'staging'}), |
| 'auto_reboot': False, |
| 'category': 'swarming', |
| } |
| |
| b_chromium_linux_swarm = { |
| 'name': 'Linux Swarm', |
| 'factory': Recipe('Release'), |
| 'auto_reboot': False, |
| 'category': 'swarming', |
| } |
| |
| b_chromium_android_swarm = { |
| 'name': 'Android Swarm', |
| 'factory': annotator_factory.AnnotatorFactory().BaseFactory( |
| 'swarming/staging', |
| factory_properties={'configuration': 'Release', 'platform': 'android'}), |
| 'category': 'swarming', |
| } |
| |
| b_chromium_mac_swarm = { |
| 'name': 'Mac Swarm', |
| 'factory': Recipe('Release'), |
| 'category': 'swarming', |
| } |
| |
| c['builders'] = [ |
| b_heartbeat, |
| b_heartbeat_staging, |
| b_chromium_linux_swarm, |
| b_chromium_android_swarm, |
| b_chromium_mac_swarm, |
| ] |
| |
| # Associate the slaves to the builders. The configuration is in slaves.cfg. |
| slaves = slaves_list.SlavesList('slaves.cfg', 'ChromiumSwarm') |
| for builder in c['builders']: |
| builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) |
| |
| |
| ####### BUILDSLAVES |
| |
| # The 'slaves' list defines the set of allowable buildslaves. List all the |
| # slaves registered to a builder. Remove dupes. |
| c['slaves'] = master_utils.AutoSetupSlaves(c['builders'], |
| config.Master.GetBotPassword()) |
| |
| # Make sure everything works together. |
| master_utils.VerifySetup(c, slaves) |
| |
| |
| ####### STATUS TARGETS |
| |
| # Must come before AutoSetupMaster(). |
| c['buildbotURL'] = ActiveMaster.buildbot_url |
| |
| # Adds common status and tools to this master. |
| master_utils.AutoSetupMaster(c, ActiveMaster, |
| public_html="../master.chromium/public_html", |
| templates=['../master.chromium/templates'], |
| tagComparator=master_poller.comparator, |
| enable_http_status_push=ActiveMaster.is_production_host) |
| |
| |
| ####### PROJECT IDENTITY |
| |
| c['projectName'] = ActiveMaster.project_name |
| c['projectURL'] = config.Master.project_url |