mozilla2-staging/master-main.cfg
author Ben Hearsum <bhearsum@mozilla.com>
Wed, 29 Jul 2009 15:32:44 -0400
changeset 1387 cd4391a87a35d9377d205d4a75353e505a727291
parent 1349 2e154a2f8c5e228cb41d38c9688fe1fba8f1547d
child 1415 159acaeebd5d9290d69777d01c492ba0bbc339bc
permissions -rw-r--r--
Actually add the files for bug 502876

# -*- python -*-
# ex: set syntax=python:

# Shorthand
c = BuildmasterConfig = {}

# most of the config is in an external file
import config
reload(config)
from config import *

####### BUILDSLAVES

import BuildSlaves
reload(BuildSlaves)
from BuildSlaves import SlavePasswords

from buildbot.buildslave import BuildSlave
c['slaves'] = []
for platform, names in SLAVES.items():
    for name in names:
        c['slaves'].append(BuildSlave(name, SlavePasswords[platform], max_builds=1))

import buildbot.status.tinderbox
reload(buildbot.status.tinderbox)

from buildbot.scheduler import Nightly
from buildbot.status.tinderbox import TinderboxMailNotifier
from buildbot.steps.shell import WithProperties
from buildbot.changes.pb import PBChangeSource

import buildbotcustom.misc
import buildbotcustom.changes.hgpoller
import buildbotcustom.process.factory
import buildbotcustom.scheduler
reload(buildbotcustom.misc)
reload(buildbotcustom.changes.hgpoller)
reload(buildbotcustom.process.factory)
reload(buildbotcustom.scheduler)
from buildbotcustom.misc import isHgPollerTriggered
from buildbotcustom.changes.hgpoller import HgPoller, HgAllLocalesPoller
from buildbotcustom.process.factory import NightlyBuildFactory, \
  NightlyRepackFactory, UnittestBuildFactory, CodeCoverageFactory, \
  UnittestPackagedBuildFactory
from buildbotcustom.scheduler import MozScheduler, NoMergeScheduler, \
  NightlyRebuild

# l10n parallelization logic
import buildbotcustom.log
import buildbotcustom.l10n
reload(buildbotcustom.log)
reload(buildbotcustom.l10n)
from buildbotcustom.l10n import NightlyL10n, Scheduler as SchedulerL10n

c['change_source'] = []
c['schedulers'] = []
c['builders'] = []
c['status'] = []

c['change_source'].append(PBChangeSource())

for name in sorted(BRANCHES.keys()):
    # shorthand
    branch = BRANCHES[name]
    builders = []
    unittestBuilders = []
    triggeredUnittestBuilders = []
    nightlyBuilders = []
    xulrunnerNightlyBuilders = []
    weeklyBuilders = []
    # This dict provides a mapping between en-US nightly scheduler names
    # and l10n nightly scheduler names. It's filled out just below here.
    l10nNightlyBuilders = {}
    # generate a list of builders, nightly builders (names must be different)
    # for easy access
    for platform in branch['platforms'].keys():
        base_name =  branch['platforms'][platform]['base_name']
        builders.append('%s build' % base_name)
        # Skip l10n, unit tests and nightlies for debug builds
        if platform.find('debug') >= 0:
            continue

        builder = '%s nightly' % base_name
        nightlyBuilders.append(builder)
        if branch['enable_shark'] and platform in ('macosx'):
            nightlyBuilders.append('%s shark' % base_name) 
        if branch['enable_l10n'] and platform in ('linux','win32','macosx'):
            l10nNightlyBuilders[builder] = {} 
            l10nNightlyBuilders[builder]['tree'] = branch['l10n_tree']
            l10nNightlyBuilders[builder]['l10n_builder'] = \
                '%s %s %s l10n' % (branch['product_name'].capitalize(),
                                   name, platform)
            l10nNightlyBuilders[builder]['platform'] = platform
        if branch['enable_unittests'] and platform in ('linux','win32','macosx'):
            unittestBuilders.append('%s unit test' % base_name)
            test_builders = []
            for suites_name, suites in UNITTEST_SUITES:
                test_builders.append('%s test %s' % (branch['platforms'][platform]['base_name'], suites_name))
            triggeredUnittestBuilders.append(('%s-%s-unittest' % (name, platform), test_builders))
        if branch['enable_codecoverage'] and platform in ('linux',):
            weeklyBuilders.append('%s code coverage' % branch['platforms'][platform]['base_name'])
        if branch['enable_xulrunner']:
            xulrunnerNightlyBuilders.append('%s xulrunner' % branch['platforms'][platform]['base_name'])

    # Currently, each branch goes to a different tree
    # If this changes in the future this may have to be
    # moved out of the loop
    c['status'].append(TinderboxMailNotifier(
        fromaddr="mozilla2.buildbot@build.mozilla.org",
        tree=branch['tinderbox_tree'],
        extraRecipients=["tinderbox-daemon@tinderbox.mozilla.org"],
        relayhost="mail.build.mozilla.org",
        builders=builders + nightlyBuilders,
        logCompression="bzip2"
    ))
    # XULRunner builds
    c['status'].append(TinderboxMailNotifier(
        fromaddr="mozilla2.buildbot@build.mozilla.org",
        tree="MozillaTest",
        extraRecipients=["tinderbox-daemon@tinderbox.mozilla.org"],
        relayhost="mail.build.mozilla.org",
        builders=xulrunnerNightlyBuilders,
        logCompression="bzip2"
    ))
    # Separate notifier for unittests, since they need to be run through
    # the unittest errorparser
    c['status'].append(TinderboxMailNotifier(
        fromaddr="mozilla2.buildbot@build.mozilla.org",
        tree=branch['tinderbox_tree'],
        extraRecipients=["tinderbox-daemon@tinderbox.mozilla.org"],
        relayhost="mail.build.mozilla.org",
        builders=unittestBuilders,
        logCompression="bzip2",
        errorparser="unittest"
    ))
    # Weekly builds (currently only code coverage) go to the MozillaTest tree
    c['status'].append(TinderboxMailNotifier(
        fromaddr="mozilla2.buildbot@build.mozilla.org",
        tree="MozillaTest",
        extraRecipients=["tinderbox-daemon@tinderbox.mozilla.org"],
        relayhost="mail.build.mozilla.org",
        builders=weeklyBuilders,
        logCompression="bzip2",
        errorparser="unittest"
    ))

    if branch['enable_l10n']:
        l10n_builders = []
        for b in l10nNightlyBuilders:
            l10n_builders.append(l10nNightlyBuilders[b]['l10n_builder'])
            l10n_builders.append(l10nNightlyBuilders[b]['l10n_builder'] + " build")
        # This notifies all l10n related build objects to Mozilla-l10n
        c['status'].append(TinderboxMailNotifier(
            fromaddr="bootstrap@mozilla.com",
            tree="MozillaStaging",
            extraRecipients=["tinderbox-daemon@tinderbox.mozilla.org"],
            relayhost="mail.build.mozilla.org",
            logCompression="bzip2",
            builders=l10n_builders,
            binaryURL="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central-l10n/"
        ))

        # We only want the builds from the specified builders
        # since their builds have a build property called "locale"
        c['status'].append(TinderboxMailNotifier(
            fromaddr="bootstrap@mozilla.com",
            tree=WithProperties("MozillaStaging-%(locale)s"),
            extraRecipients=["tinderbox-daemon@tinderbox.mozilla.org"],
            relayhost="mail.build.mozilla.org",
            logCompression="bzip2",
            builders=l10n_builders,
            binaryURL="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central-l10n/"
        ))

    # change sources
    c['change_source'].append(HgPoller(
        hgURL=HGURL,
        branch=branch['repo_path'],
        pushlogUrlOverride='%s/%s/pushlog' % (HGURL,
                                              branch['repo_path']),
        pollInterval=1*60
    ))
    
    if branch['enable_l10n']:
        hg_all_locales_poller = HgAllLocalesPoller(hgURL = HGURL,
                            repositoryIndex = branch['l10n_repo_path'],
                            pollInterval = 15*60)
        hg_all_locales_poller.parallelRequests = 1
        c['change_source'].append(hg_all_locales_poller)

    # schedulers
    # this one gets triggered by the HG Poller
    c['schedulers'].append(MozScheduler(
        name=name,
        branch=branch['repo_path'],
        treeStableTimer=3*60,
        idleTimeout=branch.get('idle_timeout', None),
        builderNames=builders + unittestBuilders,
        fileIsImportant=lambda c: isHgPollerTriggered(c, HGURL)
    ))

    for scheduler_branch, test_builders in triggeredUnittestBuilders:
        scheduler_name = scheduler_branch
        c['schedulers'].append(NoMergeScheduler(name=scheduler_name, branch=scheduler_branch, builderNames=test_builders, treeStableTimer=0))
        c['schedulers'].append(NightlyRebuild(name=scheduler_name+"-nightly",
            builderNames=test_builders,
            dayOfWeek=0, # Monday
            hour=3, minute=2, # at 3:02 am local time
            numberOfBuildsToTrigger=1, mergeBuilds=False))
        c['status'].append(TinderboxMailNotifier(
            fromaddr="mozilla2.buildbot@build.mozilla.org",
            tree=branch['tinderbox_tree'],
            extraRecipients=["tinderbox-daemon@tinderbox.mozilla.org"],
            relayhost="mail.build.mozilla.org",
            builders=test_builders,
            logCompression="bzip2",
            errorparser="unittest"
        ))

    # Now, setup the nightly en-US schedulers and maybe,
    # their downstream l10n ones
    for builder in nightlyBuilders + xulrunnerNightlyBuilders:
        nightly_scheduler=Nightly(
            name=builder,
            branch=branch['repo_path'],
            # bug 482123 - keep the minute to avoid problems with DST changes
            hour=[3], minute=[02],
            builderNames=[builder]
        )
        c['schedulers'].append(nightly_scheduler)

        if branch['enable_l10n'] and builder in l10nNightlyBuilders:
            l10n_builder = l10nNightlyBuilders[builder]['l10n_builder']
            platform = l10nNightlyBuilders[builder]['platform']
            tree = l10nNightlyBuilders[builder]['tree']
            c['schedulers'].append(NightlyL10n(
                                   name=l10n_builder,
                                   platform=platform,
                                   tree=tree,
                                   hour=[7],
                                   builderNames=[l10n_builder],
                                   repoType='hg',
                                   branch=branch['repo_path'],
                                   baseTag='default',
                                   localesFile=branch['allLocalesFile']
                                  ))

    for builder in weeklyBuilders:
        weekly_scheduler=Nightly(
            name=builder,
            branch=branch['repo_path'],
            dayOfWeek=6, # Saturday
            hour=[3], minute=[02],
            builderNames=[builder],
        )
        c['schedulers'].append(weekly_scheduler)

    for platform in sorted(branch['platforms'].keys()):
        # shorthand
        pf = branch['platforms'][platform]

        leakTest = False
        codesighs = True
        uploadPackages = True
        uploadSymbols = False
        talosMasters = TALOS_MASTERS
        if platform.find('-debug') > -1:
            leakTest = True
            codesighs = False
            uploadPackages = False
            talosMasters = None
        if platform.find('win32') > -1 or platform.find('64') > -1:
            codesighs = False
        if 'upload_symbols' in pf and pf['upload_symbols']:
            uploadSymbols = True

        buildSpace = pf.get('build_space', DEFAULT_BUILD_SPACE)
        clobberTime = pf.get('clobber_time', DEFAULT_CLOBBER_TIME)
        mochitestLeakThreshold = pf.get('mochitest_leak_threshold', None)
        crashtestLeakThreshold = pf.get('crashtest_leak_threshold', None)

        mozilla2_dep_factory = NightlyBuildFactory(
            env=pf['env'],
            objdir=pf['platform_objdir'],
            platform=platform,
            hgHost=HGHOST,
            repoPath=branch['repo_path'],
            buildToolsRepoPath=BUILD_TOOLS_REPO_PATH,
            configRepoPath=CONFIG_REPO_PATH,
            configSubDir=CONFIG_SUBDIR,
            profiledBuild=pf['profiled_build'],
            productName=branch['product_name'],
            mozconfig=pf['mozconfig'],
            stageServer=STAGE_SERVER,
            stageUsername=STAGE_USERNAME,
            stageGroup=STAGE_GROUP,
            stageSshKey=STAGE_SSH_KEY,
            stageBasePath=STAGE_BASE_PATH,
            graphServer=GRAPH_SERVER,
            graphSelector=GRAPH_SELECTOR,
            graphBranch=branch['tinderbox_tree'],
            baseName=pf['base_name'],
            leakTest=leakTest,
            codesighs=codesighs,
            uploadPackages=uploadPackages,
            uploadSymbols=False,
            buildSpace=buildSpace,
            clobberURL=BASE_CLOBBER_URL,
            clobberTime=clobberTime,
            buildsBeforeReboot=pf['builds_before_reboot'],
            talosMasters=talosMasters,
            packageTests=False,
        )
        mozilla2_dep_builder = {
            'name': '%s build' % pf['base_name'],
            'slavenames': pf['slaves'],
            'builddir': '%s-%s' % (name, platform),
            'factory': mozilla2_dep_factory,
            'category': name,
        }
        c['builders'].append(mozilla2_dep_builder)

        # skip nightlies for debug builds
        if platform.find('debug') > -1:
             continue

        nightly_builder = '%s nightly' % pf['base_name']

        mozilla2_nightly_factory = NightlyBuildFactory(
            env=pf['env'],
            objdir=pf['platform_objdir'],
            platform=platform,
            hgHost=HGHOST,
            repoPath=branch['repo_path'],
            buildToolsRepoPath=BUILD_TOOLS_REPO_PATH,
            configRepoPath=CONFIG_REPO_PATH,
            configSubDir=CONFIG_SUBDIR,
            profiledBuild=pf['profiled_build'],
            productName=branch['product_name'],
            mozconfig=pf['mozconfig'],
            stageServer=STAGE_SERVER,
            stageUsername=STAGE_USERNAME,
            stageGroup=STAGE_GROUP,
            stageSshKey=STAGE_SSH_KEY,
            stageBasePath=STAGE_BASE_PATH,
            codesighs=False,
            uploadPackages=uploadPackages,
            uploadSymbols=uploadSymbols,
            nightly=True,
            createSnippet=branch['create_snippet'],
            ausBaseUploadDir=branch['aus2_base_upload_dir'],
            updatePlatform=pf['update_platform'],
            downloadBaseURL=DOWNLOAD_BASE_URL,
            ausUser=AUS2_USER,
            ausHost=AUS2_HOST,
            buildSpace=buildSpace,
            clobberURL=BASE_CLOBBER_URL,
            clobberTime=clobberTime,
            buildsBeforeReboot=pf['builds_before_reboot'],
            talosMasters=talosMasters,
            packageTests=False,
        )

        mozilla2_nightly_builder = {
            'name': nightly_builder,
            'slavenames': pf['slaves'],
            'builddir': '%s-%s-nightly' % (name, platform),
            'factory': mozilla2_nightly_factory,
            'category': name,
        }
        c['builders'].append(mozilla2_nightly_builder)

        if branch['enable_l10n']:
            if platform in ('linux','win32','macosx'):
                mozilla2_l10n_nightly_factory = NightlyRepackFactory(
                    hgHost=HGHOST,
                    tree=branch['l10n_tree'],
                    project=branch['product_name'],
                    appName=branch['app_name'],
                    enUSBinaryURL=branch['enUS_binaryURL'],
                    nightly=True,
                    l10nNightlyUpdate=branch['l10nNightlyUpdate'],
                    l10nDatedDirs=branch['l10nDatedDirs'],
                    createSnippet=branch['create_snippet'],
                    ausBaseUploadDir=branch['aus2_base_upload_dir'],
                    updatePlatform=pf['update_platform'],
                    downloadBaseURL=DOWNLOAD_BASE_URL,
                    ausUser=AUS2_USER,
                    ausHost=AUS2_HOST,
                    stageServer=STAGE_SERVER,
                    stageUsername=STAGE_USERNAME,
                    stageSshKey=STAGE_SSH_KEY,
                    repoPath=branch['repo_path'],
                    l10nRepoPath=branch['l10n_repo_path'],
                    buildToolsRepoPath=BUILD_TOOLS_REPO_PATH,
                    compareLocalesRepoPath=COMPARE_LOCALES_REPO_PATH,
                    compareLocalesTag=COMPARE_LOCALES_TAG,
                    buildSpace=2,
                    clobberURL=BASE_CLOBBER_URL,
                    clobberTime=clobberTime,
                )
                mozilla2_l10n_nightly_builder = {
                    'name': l10nNightlyBuilders[nightly_builder]['l10n_builder'],
                    'slavenames': L10N_SLAVES[platform],
                    'builddir': '%s-%s-l10n-nightly' % (name, platform),
                    'factory': mozilla2_l10n_nightly_factory,
                    'category': name,
                }
                c['builders'].append(mozilla2_l10n_nightly_builder)
                mozilla2_l10n_dep_factory = NightlyRepackFactory(
                    hgHost=HGHOST,
                    tree=branch['l10n_tree'],
                    project=branch['product_name'],
                    appName=branch['app_name'],
                    enUSBinaryURL=branch['enUS_binaryURL'],
                    nightly=False,
                    l10nDatedDirs=branch['l10nDatedDirs'],
                    stageServer=STAGE_SERVER,
                    stageUsername=STAGE_USERNAME,
                    stageSshKey=STAGE_SSH_KEY,
                    repoPath=branch['repo_path'],
                    l10nRepoPath=branch['l10n_repo_path'],
                    buildToolsRepoPath=BUILD_TOOLS_REPO_PATH,
                    compareLocalesRepoPath=COMPARE_LOCALES_REPO_PATH,
                    compareLocalesTag=COMPARE_LOCALES_TAG,
                    buildSpace=2,
                    clobberURL=BASE_CLOBBER_URL,
                    clobberTime=clobberTime,
                )
                mozilla2_l10n_dep_builder = {
                    'name': l10nNightlyBuilders[nightly_builder]['l10n_builder'] + " build",
                    'slavenames': L10N_SLAVES[platform],
                    'builddir': '%s-%s-l10n-dep' % (name, platform),
                    'factory': mozilla2_l10n_dep_factory,
                    'category': name,
                }
                c['builders'].append(mozilla2_l10n_dep_builder)

        if branch['enable_unittests']:
            if platform in ('linux','win32','macosx'):
                runA11y = True
                if platform == 'macosx':
                    runA11y = branch['enable_mac_a11y']

                unittest_factory = UnittestBuildFactory(
                    platform=platform,
                    productName=branch['product_name'],
                    config_repo_path=CONFIG_REPO_PATH,
                    config_dir=CONFIG_SUBDIR,
                    objdir=OBJDIR_UNITTESTS,
                    hgHost=HGHOST,
                    repoPath=branch['repo_path'],
                    buildToolsRepoPath=BUILD_TOOLS_REPO_PATH,
                    buildSpace=branch['unittest_build_space'],
                    clobberURL=BASE_CLOBBER_URL,
                    clobberTime=clobberTime,
                    buildsBeforeReboot=pf['builds_before_reboot'],
                    run_a11y=runA11y,
                    mochitest_leak_threshold=mochitestLeakThreshold,
                    crashtest_leak_threshold=crashtestLeakThreshold,
                    stageServer=STAGE_SERVER,
                    stageUsername=STAGE_USERNAME,
                    stageSshKey=STAGE_SSH_KEY,
                    unittestMasters=UNITTEST_MASTERS,
                    uploadPackages=True,
                )
                unittest_builder = {
                    'name': '%s unit test' % pf['base_name'],
                    'slavenames': pf['slaves'],
                    'builddir': '%s-%s-unittest' % (name, platform),
                    'factory': unittest_factory,
                    'category': name,
                }
                c['builders'].append(unittest_builder)

                for suites_name, suites in UNITTEST_SUITES:
                    # If we're not supposed to run the a11y tests, then
                    # remove the mochitest-a11y suite
                    if not runA11y and 'mochitest-a11y' in suites:
                        suites = suites[:]
                        suites.remove('mochitest-a11y')
                    packaged_unittest_factory = UnittestPackagedBuildFactory(
                        platform=platform,
                        test_suites=suites,
                        mochitest_leak_threshold=mochitestLeakThreshold,
                        crashtest_leak_threshold=crashtestLeakThreshold,
                        hgHost=HGHOST,
                        repoPath=branch['repo_path'],
                        buildToolsRepoPath=BUILD_TOOLS_REPO_PATH,
                        buildSpace=0.5,
                        buildsBeforeReboot=pf['builds_before_reboot'],
                    )
                    packaged_unittest_builder = {
                        'name': '%s test %s' % (pf['base_name'], suites_name),
                        'slavenames': pf['slaves'],
                        'builddir': '%s-%s-unittest-%s' % (name, platform, suites_name),
                        'factory': packaged_unittest_factory,
                        'category': name,
                    }
                    c['builders'].append(packaged_unittest_builder)

        if branch['enable_codecoverage']:
            # We only do code coverage builds on linux right now
            if platform == 'linux':
                codecoverage_factory = CodeCoverageFactory(
                    platform=platform,
                    productName=branch['product_name'],
                    config_repo_path=CONFIG_REPO_PATH,
                    config_dir=CONFIG_SUBDIR,
                    objdir=OBJDIR_UNITTESTS,
                    hgHost=HGHOST,
                    repoPath=branch['repo_path'],
                    buildToolsRepoPath=BUILD_TOOLS_REPO_PATH,
                    buildSpace=5,
                    clobberURL=BASE_CLOBBER_URL,
                    clobberTime=clobberTime,
                    buildsBeforeReboot=pf['builds_before_reboot'],
                    mochitest_leak_threshold=mochitestLeakThreshold,
                    crashtest_leak_threshold=crashtestLeakThreshold,
                    stageServer=STAGE_SERVER,
                    stageUsername=STAGE_USERNAME,
                    stageSshKey=STAGE_SSH_KEY,
                )
                codecoverage_builder = {
                    'name': '%s code coverage' % pf['base_name'],
                    'slavenames': pf['slaves'],
                    'builddir': '%s-%s-codecoverage' % (name, platform),
                    'factory': codecoverage_factory,
                    'category': name,
                }
                c['builders'].append(codecoverage_builder)

        if branch['enable_shark'] and platform in ('macosx'):
             mozilla2_shark_factory = NightlyBuildFactory(
                 env= pf['env'],
                 objdir=OBJDIR,
                 platform=platform,
                 hgHost=HGHOST,
                 repoPath=branch['repo_path'],
                 buildToolsRepoPath=BUILD_TOOLS_REPO_PATH,
                 configRepoPath=CONFIG_REPO_PATH,
                 configSubDir=CONFIG_SUBDIR,
                 profiledBuild=False,
                 productName=branch['product_name'],
                 mozconfig='macosx/%s/shark' % name,
                 stageServer=STAGE_SERVER,
                 stageUsername=STAGE_USERNAME,
                 stageGroup=STAGE_GROUP,
                 stageSshKey=STAGE_SSH_KEY,
                 stageBasePath=STAGE_BASE_PATH,
                 codesighs=False,
                 uploadPackages=uploadPackages,
                 uploadSymbols=False,
                 nightly=True,
                 createSnippet=False,
                 buildSpace=buildSpace,
                 clobberURL=BASE_CLOBBER_URL,
                 clobberTime=clobberTime,
                 buildsBeforeReboot=pf['builds_before_reboot']
             )
             mozilla2_shark_builder = {
                 'name': '%s shark' % pf['base_name'],
                 'slavenames': pf['slaves'],
                 'builddir': '%s-%s-shark' % (name, platform),
                 'factory': mozilla2_shark_factory,
                 'category': name,
             }
             c['builders'].append(mozilla2_shark_builder)

        if branch['enable_xulrunner']:
             xr_env = pf['env'].copy()
             xr_env['SYMBOL_SERVER_USER'] = STAGE_USERNAME_XULRUNNER
             xr_env['SYMBOL_SERVER_PATH'] = SYMBOL_SERVER_XULRUNNER_PATH
             xr_env['SYMBOL_SERVER_SSH_KEY'] = \
                 xr_env['SYMBOL_SERVER_SSH_KEY'].replace(STAGE_SSH_KEY, STAGE_SSH_XULRUNNER_KEY)
             mozilla2_xulrunner_factory = NightlyBuildFactory(
                 env= xr_env,
                 objdir=pf['platform_objdir'],
                 platform=platform,
                 hgHost=HGHOST,
                 repoPath=branch['repo_path'],
                 buildToolsRepoPath=BUILD_TOOLS_REPO_PATH,
                 configRepoPath=CONFIG_REPO_PATH,
                 configSubDir=CONFIG_SUBDIR,
                 profiledBuild=False,
                 productName='xulrunner',
                 mozconfig='%s/%s/xulrunner' % (platform, name),
                 stageServer=STAGE_SERVER,
                 stageUsername=STAGE_USERNAME_XULRUNNER,
                 stageGroup=STAGE_GROUP,
                 stageSshKey=STAGE_SSH_XULRUNNER_KEY,
                 stageBasePath=STAGE_BASE_PATH_XULRUNNER,
                 codesighs=False,
                 uploadPackages=uploadPackages,
                 uploadSymbols=True,
                 nightly=True,
                 createSnippet=False,
                 buildSpace=buildSpace,
                 clobberURL=BASE_CLOBBER_URL,
                 clobberTime=clobberTime,
                 buildsBeforeReboot=pf['builds_before_reboot'],
                 packageSDK=True,
             )
             mozilla2_xulrunner_builder = {
                 'name': '%s xulrunner' % pf['base_name'],
                 'slavenames': pf['slaves'],
                 'builddir': '%s-%s-xulrunner' % (name, platform),
                 'factory': mozilla2_xulrunner_factory,
                 'category': name,
             }
             c['builders'].append(mozilla2_xulrunner_builder)



####### L10n Scheduler with multiple dispatchers

# for debugging purposes of the repack on locale change system
buildbotcustom.log.init(
    scheduler = buildbotcustom.log.DEBUG,
    dispatcher = buildbotcustom.log.DEBUG
)

s = SchedulerL10n("l10n", "l10nbuilds.ini")
c['schedulers'].append(s)

####### Mobile

import mobile_master
reload(mobile_master)

c['builders'].extend(mobile_master.m['builders'])
c['schedulers'].extend(mobile_master.m['schedulers'])
c['change_source'].extend(mobile_master.m['change_source'])
c['status'].extend(mobile_master.m['status'])

####### Release Automation

import release_master
reload(release_master)

c['builders'].extend(release_master.builders)
c['schedulers'].extend(release_master.schedulers)
c['change_source'].extend(release_master.change_source)
c['status'].extend(release_master.status)

# Give the release builders priority over other builders
def prioritizeBuilders(botmaster, builders):
    def sortkey(builder):
        if builder.builder_status.category == 'release':
            return 0, builder.getOldestRequestTime()
        else:
            return 1, builder.getOldestRequestTime()
    builders.sort(key=sortkey)
    return builders
c['prioritizeBuilders'] = prioritizeBuilders

####### PROJECT IDENTITY

# the 'projectName' string will be used to describe the project that this
# buildbot is working on. For example, it is used as the title of the
# waterfall HTML page. The 'projectURL' string will be used to provide a link
# from buildbot HTML pages to your project's home page.

c['projectName'] = "Mozilla 2"
c['projectURL'] = "http://wiki.mozilla.org/Mozilla_2"

######## For staging environments
### uncomment the lines below to disable all schedulers and change sources so
### that you can control exactly which builds happen

# c['schedulers'] = []
# c['change_source'] = []