new file mode 100644
--- /dev/null
+++ b/mozilla2/master.cfg
@@ -0,0 +1,279 @@
+# -*- python -*-
+# ex: set syntax=python:
+
+# Shorthand
+c = BuildmasterConfig = {}
+
+####### BUILDSLAVES
+
+import BuildSlaves
+reload(BuildSlaves)
+c['slaves'] = BuildSlaves.SlaveList
+
+# 'slavePortnum' defines the TCP port to listen on. This must match the value
+# configured into the buildslaves (with their --master option)
+
+c['slavePortnum'] = 9989
+
+
+####### SCHEDULERS, CHANGE SOURCES, AND BUILDERS
+
+HGURL = 'http://hg.mozilla.org/'
+# for nss/nspr
+CVSROOT = ':ext:stgbld@cvs.mozilla.org:/cvsroot'
+# TODO: update this after production repo is created
+CONFIG_REPO_URL = 'http://hg.mozilla.org/build/buildbot-configs/mozilla2'
+OBJDIR = 'obj-firefox'
+STAGE_USERNAME = 'ffxbld'
+STAGE_SERVER = 'stage.mozilla.org'
+# TODO: update this soon
+STAGE_BASE_PATH = '/home/ffxbld/moz2-builds'
+STAGE_GROUP = None
+STAGE_SSH_KEY = 'ffxbld_dsa'
+BRANCHES = {'mozilla-central': {}}
+BRANCHES['mozilla-central']['platforms'] = {'linux': {}, 'win32': {}, 'macosx': {}}
+BRANCHES['mozilla-central']['platforms']['linux']['slaves'] = ['moz2-linux-slave1']
+BRANCHES['mozilla-central']['platforms']['win32']['slaves'] = ['moz2-win32-slave1']
+BRANCHES['mozilla-central']['platforms']['macosx']['slaves'] = ['moz2-mac-slave1']
+BRANCHES['mozilla-central']['platforms']['linux']['env'] = {
+ 'MOZ_OBJDIR': OBJDIR
+}
+BRANCHES['mozilla-central']['platforms']['win32']['env'] = {'CVS_RSH': 'ssh',
+ 'MOZ_OBJDIR': OBJDIR
+}
+BRANCHES['mozilla-central']['platforms']['macosx']['env'] = {
+ 'MOZ_OBJDIR': OBJDIR
+}
+
+
+from buildbot.process import factory
+from buildbot.changes.hgpoller import HgPoller
+from buildbot.scheduler import Scheduler, Nightly, Periodic
+from buildbot.steps.source import Mercurial
+from buildbot.steps.transfer import FileDownload
+from buildbot.steps.shell import Compile, ShellCommand, WithProperties
+from buildbot.locks import SlaveLock
+
+import buildbotcustom
+reload(buildbotcustom)
+
+from buildbotcustom.steps.misc import GetBuildID
+from buildbotcustom.steps.transfer import MozillaStageUpload
+
+c['sources'] = []
+c['schedulers'] = []
+c['builders'] = []
+
+for name in BRANCHES.keys():
+ # shorthand
+ branch = BRANCHES[name]
+ builders = []
+ nightlyBuilders = []
+ # generate a list of builders, nightly builders (names must be different)
+ # for easy access
+ for platform in branch['platforms'].keys():
+ builders.append('%s-%s' % (name, platform))
+ nightlyBuilders.append('%s-%s-nightly' % (name, platform))
+
+ # change sources
+ c['sources'].append(HgPoller(
+ hgURL=HGURL,
+ branch=name,
+ pollInterval=1*60
+ ))
+
+ # schedulers
+ c['schedulers'].append(Scheduler(
+ name=name,
+ branch=name,
+ treeStableTimer=3*60,
+ builderNames=builders
+ ))
+ c['schedulers'].append(Nightly(
+ name='%s nightly' % name,
+ branch=name,
+ hour=[2],
+ builderNames=nightlyBuilders
+ ))
+
+ for platform in branch['platforms'].keys():
+ # make sure nightly and dep don't run at the same time
+ lock = SlaveLock(name=platform, maxCount=1)
+
+ mozilla2_dep_factory = factory.BuildFactory()
+ mozilla2_dep_factory.addStep(Mercurial(
+ mode='update',
+ baseURL=HGURL,
+ defaultBranch=name
+ ))
+ mozilla2_dep_factory.addStep(ShellCommand(
+ command=['python', 'client.py', '--cvsroot=%s' % CVSROOT,
+ WithProperties('--mozilla-repo=' + HGURL + '%(branch)s'),
+ 'checkout'],
+ env=branch['platforms'][platform]['env'],
+ haltOnFailure=True
+ ))
+ mozilla2_dep_factory.addStep(ShellCommand(
+ command=['rm', '-rfv', 'configs'],
+ haltOnFailure=True
+ ))
+ mozilla2_dep_factory.addStep(ShellCommand(
+ command=['hg', 'clone', CONFIG_REPO_URL, 'configs'],
+ haltOnFailure=True
+ ))
+ mozilla2_dep_factory.addStep(ShellCommand(
+ command=['cp', 'configs/%s/mozconfig' % platform, '.mozconfig'],
+ haltOnFailure=True
+ ))
+ mozilla2_dep_factory.addStep(ShellCommand(
+ command=['cat', '.mozconfig'],
+ ))
+ mozilla2_dep_factory.addStep(Compile(
+ command=['make', '-f', 'client.mk', 'build'],
+ env=branch['platforms'][platform]['env'],
+ haltOnFailure=True
+ ))
+ mozilla2_dep_factory.addStep(ShellCommand(
+ command=['make', 'package'],
+ workdir='build/%s' % OBJDIR,
+ haltOnFailure=True
+ ))
+ if platform == "win32":
+ mozilla2_dep_factory.addStep(ShellCommand(
+ command=['make', 'installer'],
+ workdir='build/%s' % OBJDIR,
+ haltOnFailure=True
+ ))
+ mozilla2_dep_factory.addStep(GetBuildID(
+ objdir=OBJDIR
+ ))
+ mozilla2_dep_factory.addStep(MozillaStageUpload(
+ objdir=OBJDIR,
+ username=STAGE_USERNAME,
+ milestone=name,
+ remoteHost=STAGE_SERVER,
+ remoteBasePath=STAGE_BASE_PATH,
+ platform=platform,
+ group=STAGE_GROUP,
+ sshKey=STAGE_SSH_KEY,
+ releaseToLatest=False,
+ releaseToDated=False,
+ releaseToTinderboxBuilds=True
+ ))
+
+ mozilla2_dep_builder = {
+ 'name': '%s-%s' % (name, platform),
+ 'slavenames': branch['platforms'][platform]['slaves'],
+ 'builddir': '%s-%s' % (name, platform),
+ 'factory': mozilla2_dep_factory,
+ 'category': name,
+ 'locks': [lock]
+ }
+ c['builders'].append(mozilla2_dep_builder)
+
+ # TODO: does all of this have to be repeated? the only change is 'mode'
+ mozilla2_nightly_factory = factory.BuildFactory()
+ mozilla2_nightly_factory.addStep(Mercurial(
+ mode='clobber',
+ baseURL=HGURL,
+ defaultBranch=name
+ ))
+ mozilla2_nightly_factory.addStep(ShellCommand(
+ command=['python', 'client.py', '--cvsroot=%s' % CVSROOT,
+ WithProperties('--mozilla-repo=' + HGURL + '%(branch)s'),
+ 'checkout'],
+ env=branch['platforms'][platform]['env'],
+ haltOnFailure=True
+ ))
+ mozilla2_nightly_factory.addStep(ShellCommand(
+ command=['rm', '-rfv', 'configs'],
+ haltOnFailure=True
+ ))
+ mozilla2_nightly_factory.addStep(ShellCommand(
+ command=['hg', 'clone', CONFIG_REPO_URL, 'configs'],
+ haltOnFailure=True
+ ))
+ mozilla2_nightly_factory.addStep(ShellCommand(
+ command=['cp', 'configs/%s/mozconfig' % platform, '.mozconfig'],
+ haltOnFailure=True
+ ))
+ mozilla2_nightly_factory.addStep(ShellCommand(
+ command=['cat', '.mozconfig'],
+ ))
+ mozilla2_nightly_factory.addStep(Compile(
+ command=['make', '-f', 'client.mk', 'build'],
+ env=branch['platforms'][platform]['env'],
+ haltOnFailure=True
+ ))
+ mozilla2_nightly_factory.addStep(ShellCommand(
+ command=['make', 'package'],
+ workdir='build/%s' % OBJDIR,
+ haltOnFailure=True
+ ))
+ if platform == "win32":
+ mozilla2_nightly_factory.addStep(ShellCommand(
+ command=['make', 'installer'],
+ workdir='build/%s' % OBJDIR,
+ haltOnFailure=True
+ ))
+ mozilla2_nightly_factory.addStep(GetBuildID(
+ objdir=OBJDIR
+ ))
+ mozilla2_nightly_factory.addStep(MozillaStageUpload(
+ objdir=OBJDIR,
+ username=STAGE_USERNAME,
+ milestone=name,
+ remoteHost=STAGE_SERVER,
+ remoteBasePath=STAGE_BASE_PATH,
+ platform=platform,
+ group=STAGE_GROUP,
+ sshKey=STAGE_SSH_KEY,
+ releaseToDated=True,
+ releaseToLatest=True,
+ releaseToTinderboxBuilds=True
+ ))
+
+ mozilla2_nightly_builder = {
+ 'name': '%s-%s-nightly' % (name, platform),
+ 'slavenames': branch['platforms'][platform]['slaves'],
+ 'builddir': '%s-%s-nightly' % (name, platform),
+ 'factory': mozilla2_nightly_factory,
+ 'category': name,
+ 'locks': [lock]
+ }
+ c['builders'].append(mozilla2_nightly_builder)
+
+
+####### STATUS TARGETS
+
+c['status'] = []
+
+from buildbot.status import html
+
+# This one's private.
+c['status'].append(html.WebStatus(
+ http_port=8010, allowForce=True
+))
+# This one's public.
+c['status'].append(html.WebStatus(
+ distrib_port=8011, allowForce=False
+))
+
+
+####### 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"
+
+# the 'buildbotURL' string should point to the location where the buildbot's
+# internal web server (usually the html.Waterfall page) is visible. This
+# typically uses the port number set in the Waterfall 'status' entry, but
+# with an externally-visible host name which the buildbot cannot figure out
+# without some help.
+
+c['buildbotURL'] = "http://staging-master.build.mozilla.org:8010/"