Get staging mobile and mozilla2 configs into version control. r=robcee, patch=me
authorBen Hearsum <bhearsum@mozilla.com>
Tue, 22 Apr 2008 09:58:40 -0400
changeset 30 3ab37e1b932337636d47264fe0e60a92124ad857
parent 29 8e360f18cb329d49b8b0158a5f4a3fde88ad735d
child 31 aedc62e0b0115d324ca3cbe3843885d51e43d164
push id1
push userroot
push dateWed, 17 Dec 2014 00:18:48 +0000
reviewersrobcee
Get staging mobile and mozilla2 configs into version control. r=robcee, patch=me
mobile-staging/linux-arm/mozconfig
mobile-staging/master.cfg
mozilla2-staging/linux/mozconfig
mozilla2-staging/macosx/mozconfig
mozilla2-staging/master.cfg
mozilla2-staging/public_html/buildbot.css
mozilla2-staging/win32/mozconfig
new file mode 100644
--- /dev/null
+++ b/mobile-staging/linux-arm/mozconfig
@@ -0,0 +1,9 @@
+mk_add_options MOZ_CO_PROJECT=xulrunner
+mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/xr-linux-arm
+ac_add_options --enable-application=xulrunner
+ac_add_options --disable-jemalloc
+ac_add_options --disable-tests
+ac_add_options --enable-extensions=softkb
+ac_add_options --disable-javaxpcom
+
+HILDON=1
new file mode 100644
--- /dev/null
+++ b/mobile-staging/master.cfg
@@ -0,0 +1,355 @@
+# -*- 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'] = 9020
+
+
+####### SCHEDULERS AND CHANGE SOURCES
+c['sources'] = []
+c['schedulers'] = []
+
+from buildbot.changes.bonsaipoller import BonsaiPoller
+from buildbot.scheduler import Scheduler, Nightly
+
+c['sources'].append(BonsaiPoller(
+    bonsaiURL = 'http://bonsai.mozilla.org',
+    module = 'AviarySuiteBranchTinderbox',
+    branch = 'HEAD',
+    pollInterval = 1 * 60
+))
+
+#c['schedulers'].append(Scheduler(
+#    name="mobile dep scheduler",
+#    branch="HEAD",
+#    treeStableTimer=3*60,
+#    builderNames=["mobile-linux-arm-dep"]
+#))
+#c['schedulers'].append(Nightly(
+#    name="mobile nightly scheduler",
+#    branch="HEAD",
+#    hour=[1],
+#    builderNames=["mobile-linux-arm-nightly"]
+#))
+
+
+####### BUILDERS
+CVSROOT = ':ext:stgbld@cvs.mozilla.org:/cvsroot'
+OBJDIR = 'xr-linux-arm'
+CONFIG_REPO_URL = 'http://hg.mozilla.org/build/buildbot-configs'
+CONFIG_SUBDIR = 'mobile-staging'
+STAGE_USERNAME = 'mobilebld'
+STAGE_SERVER = 'notstage.mozilla.org'
+STAGE_BASE_PATH = '/home/mobilebld/mobile-builds'
+STAGE_GROUP = 'mobilebld'
+STAGE_SSH_KEY = 'mobilebld_dsa'
+SBOX_HOME = '/scratchbox/users/cltbld/home/cltbld'
+
+c['builders'] = []
+
+from buildbot.process import factory
+from buildbot.steps.transfer import FileDownload
+from buildbot.steps.shell import Compile, ShellCommand, WithProperties
+from buildbot.locks import SlaveLock
+
+linux_lock = SlaveLock(name='linux_arm_lock', maxCount=1)
+
+linux_arm_dep_factory = factory.BuildFactory()
+linux_arm_dep_factory.addStep(ShellCommand(
+    command = "rm /tmp/*_cltbld.log",
+    description=['removing', 'logfile'],
+    descriptionDone=['remove', 'logfile'],
+    haltOnFailure=False,
+    flunkOnFailure=False,
+    warnOnFailure=False
+))
+linux_arm_dep_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p',
+               'mkdir -p dep'],
+    description=['creating', 'dep dir'],
+    descriptionDone=['create', 'dep dir'],
+    haltOnFailure=True
+))
+linux_arm_dep_factory.addStep(ShellCommand(
+    # configure needs to be deleted since we regenerate it every time.
+    #  if we don't delete it we get checkout conflicts
+    # configs/ is the mozconfig repo; we check this out every time
+    # extensions/softkb/ gets patched and copied over every time
+    command = ['/scratchbox/login', '-p', '-d', 'dep',
+               'rm -rfv mozilla/configure mozilla/configs/ ' + \
+                 'mozilla/extensions/softkb/'],
+    description=['cleaning up'],
+    descriptionDone=['cleanup'],
+    haltOnFailure=True
+))
+linux_arm_dep_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'dep',
+               'cvs -d %s co mozilla/client.mk' % CVSROOT],
+    description=['checkout client.mk'],
+    descriptionDone=['checked out', 'client.mk'],
+    haltOnFailure=True,
+))
+linux_arm_dep_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'dep/mozilla',
+               'hg clone %s configs' % CONFIG_REPO_URL],
+    description=['checkout configs'],
+    descriptionDone=['checked out', 'configs'],
+    haltOnFailure=True
+))
+linux_arm_dep_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'dep/mozilla',
+               'cp configs/%s/linux-arm/mozconfig .mozconfig' % CONFIG_SUBDIR],
+    description=['copy mozconfig'],
+    descriptionDone=['copied mozconfig'],
+    haltOnFailure=True
+))
+linux_arm_dep_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'dep/mozilla',
+               'make -f client.mk checkout'],
+    description=['checkout code'],
+    descriptionDone=['checked out', 'code'],
+    haltOnFailure=True
+))
+linux_arm_dep_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'dep',
+               'cvs -d %s co mozilla/minimo/components/softkb' % CVSROOT],
+    description=['checking', 'out', 'softkb'],
+    descriptionDone=['checked', 'out', 'softkb'],
+    haltOnFailure=True
+))
+linux_arm_dep_factory.addStep(FileDownload(
+    mastersrc='softkb.diff',
+    slavedest='softkb.diff',
+    workdir='%s/dep' % SBOX_HOME
+))
+linux_arm_dep_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'dep/mozilla',
+               'patch -N -p0 -i ../softkb.diff'],
+    description=['patching', 'for', 'softkb'],
+    descriptionDone=['patched', 'for', 'softkb'],
+    # this will return 1 on subsequent patches, we have to ignore it
+    haltOnFailure=False,
+    warnOnFailure=False,
+    flunkOnFailure=False
+))
+linux_arm_dep_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'dep/mozilla',
+               'mv -f minimo/components/softkb extensions/'],
+    description=['moving', 'softkb'],
+    descriptionDone=['move', 'softkb'],
+    haltOnFailure=True
+))
+linux_arm_dep_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'dep/mozilla',
+               'autoconf2.13'],
+    description=['running', 'autoconf'],
+    descriptionDone=['run', 'autoconf'],
+    haltOnFailure=True
+))
+linux_arm_dep_factory.addStep(Compile(
+    command = ['/scratchbox/login', '-p', '-d', 'dep/mozilla',
+               'make -f client.mk build'],
+    env={'PKG_CONFIG_PATH': '/usr/lib/pkgconfig/:/usr/local/lib/pkgconfig'},
+    haltOnFailure=True
+))
+linux_arm_dep_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'dep/mozilla/%s' % OBJDIR,
+               'make package'],
+    description=['make package'],
+    haltOnFailure=True
+))
+#linux_arm_dep_factory.addStep(ShellCommand(
+#    command = ['/scratchbox/login', '-p', '-d', 'dep/mozilla',
+#               'ssh mobilebld@stage.mozilla.org ' + \
+#               'mkdir -p /home/ftp/pub/mobile/dep'],
+#    description=['creating', 'upload dir'],
+#    descriptionDone=['create', 'upload dir'],
+#    haltOnFailure=False
+#))
+#linux_arm_dep_factory.addStep(ShellCommand(
+#    workdir='%s/dep/mozilla/%s' % (SBOX_HOME, OBJDIR),
+#    command = ['bash', '-c',
+#               'scp dist/*.tar.bz2 ' + \
+#               'mobilebld@stage.mozilla.org:/home/ftp/pub/mobile/dep'],
+#    description=['uploading', 'build'],
+#    descriptionDone=['upload', 'build'],
+#    haltOnFailure=True
+#))
+
+linux_arm_dep_builder = {
+    'name': 'mobile-linux-arm-dep',
+    'slavenames': ['staging-mobile-linux-slave1'],
+    'builddir': 'mobile-linux-arm-dep',
+    'factory': linux_arm_dep_factory,
+    'category': 'mobile',
+    'locks': [linux_lock]
+}
+c['builders'].append(linux_arm_dep_builder)
+
+
+linux_arm_nightly_factory = factory.BuildFactory()
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = "rm /tmp/*_cltbld.log",
+    description=['removing', 'logfile'],
+    descriptionDone=['remove', 'logfile'],
+    haltOnFailure=False,
+    flunkOnFailure=False,
+    warnOnFailure=False
+))
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p',
+               'mkdir -p nightly'],
+    description=['creating', 'nightly dir'],
+    descriptionDone=['create', 'nightly dir'],
+    haltOnFailure=True
+))
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'nightly',
+               'rm -rfv mozilla/'],
+    description=['clobbering'],
+    descriptionDone=['clobber'],
+    haltOnFailure=True
+))
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'nightly',
+               'cvs -d %s co mozilla/client.mk' % CVSROOT],
+    description=['checkout client.mk'],
+    descriptionDone=['checked out', 'client.mk'],
+    haltOnFailure=True,
+))
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'nightly/mozilla',
+               'hg clone %s configs' % CONFIG_REPO_URL],
+    description=['checkout configs'],
+    descriptionDone=['checked out', 'configs'],
+    haltOnFailure=True
+))
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'nightly/mozilla',
+               'cp configs/%s/linux-arm/mozconfig .mozconfig' % CONFIG_SUBDIR],
+    description=['copy mozconfig'],
+    descriptionDone=['copied mozconfig'],
+    haltOnFailure=True
+))
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'nightly/mozilla',
+               'make -f client.mk checkout'],
+    description=['checkout code'],
+    descriptionDone=['checked out', 'code'],
+    haltOnFailure=True
+))
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'nightly',
+               'cvs -d %s co mozilla/minimo/components/softkb' % CVSROOT],
+    description=['checking', 'out', 'softkb'],
+    descriptionDone=['checked', 'out', 'softkb'],
+    haltOnFailure=True
+))
+linux_arm_nightly_factory.addStep(FileDownload(
+    mastersrc='softkb.diff',
+    slavedest='softkb.diff',
+    workdir='%s/nightly' % SBOX_HOME
+))
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'nightly/mozilla',
+               'patch -N -p0 -i ../softkb.diff'],
+    description=['patching', 'for', 'softkb'],
+    descriptionDone=['patched', 'for', 'softkb'],
+    # this will return 1 on subsequent patches, we have to ignore it
+    haltOnFailure=False,
+    warnOnFailure=False,
+    flunkOnFailure=False
+))
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'nightly/mozilla',
+               'mv -f minimo/components/softkb extensions/'],
+    description=['moving', 'softkb'],
+    descriptionDone=['move', 'softkb'],
+    haltOnFailure=True
+))
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'nightly/mozilla',
+               'autoconf2.13'],
+    description=['running', 'autoconf'],
+    descriptionDone=['run', 'autoconf'],
+    haltOnFailure=True
+))
+linux_arm_nightly_factory.addStep(Compile(
+    command = ['/scratchbox/login', '-p', '-d', 'nightly/mozilla',
+               'make -f client.mk build'],
+    env={'PKG_CONFIG_PATH': '/usr/lib/pkgconfig/:/usr/local/lib/pkgconfig'},
+    haltOnFailure=True
+))
+linux_arm_nightly_factory.addStep(ShellCommand(
+    command = ['/scratchbox/login', '-p', '-d', 'nightly/mozilla/%s' % OBJDIR,
+               'make package'],
+    description=['make package'],
+    haltOnFailure=True
+))
+#linux_arm_nightly_factory.addStep(ShellCommand(
+#    command = ['/scratchbox/login', '-p', '-d', 'nightly/mozilla',
+#               'ssh mobilebld@stage.mozilla.org ' + \
+#               'mkdir -p /home/ftp/pub/mobile/nightly'],
+#    description=['creating', 'upload dir'],
+#    descriptionDone=['create', 'upload dir'],
+#    haltOnFailure=True
+#))
+#linux_arm_nightly_factory.addStep(ShellCommand(
+#    workdir='%s/nightly/mozilla/%s' % (SBOX_HOME, OBJDIR),
+#    command = ['bash', '-c',
+#               'scp dist/*.tar.bz2 ' + \
+#               'mobilebld@stage.mozilla.org:/home/ftp/pub/mobile/nightly'],
+#    description=['uploading', 'build'],
+#    descriptionDone=['upload', 'build'],
+#    haltOnFailure=True
+#))
+
+linux_arm_nightly_builder = {
+    'name': 'mobile-linux-arm-nightly',
+    'slavenames': ['staging-mobile-linux-slave1'],
+    'builddir': 'mobile-linux-arm-nightly',
+    'factory': linux_arm_nightly_factory,
+    'category': 'mobile',
+    'locks': [linux_lock]
+}
+c['builders'].append(linux_arm_nightly_builder)
+
+
+####### STATUS TARGETS
+
+c['status'] = []
+
+from buildbot.status import html
+
+c['status'].append(html.WebStatus(
+    http_port=8020, allowForce=True
+))
+
+####### 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 Staging Mobile"
+c['projectURL'] = "http://wiki.mozilla.org/Mobile"
+
+# 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:8020/"
new file mode 100644
--- /dev/null
+++ b/mozilla2-staging/linux/mozconfig
@@ -0,0 +1,14 @@
+ac_add_options --enable-application=browser
+ac_add_options --enable-optimize="-Os"
+ac_add_options --enable-update-channel=nightly
+ac_add_options --enable-update-packaging
+ac_add_options --disable-debug
+
+CC=/tools/gcc/bin/gcc
+CXX=/tools/gcc/bin/g++
+
+export CFLAGS="-gstabs+"
+export CXXFLAGS="-gstabs+"
+
+# Needed to enable breakpad in application.ini
+export MOZILLA_OFFICIAL=1
new file mode 100644
--- /dev/null
+++ b/mozilla2-staging/macosx/mozconfig
@@ -0,0 +1,13 @@
+. $topsrcdir/build/macosx/universal/mozconfig
+ac_add_app_options ppc --enable-prebinding
+
+ac_add_options --enable-application=browser
+ac_add_options --enable-update-channel=nightly
+ac_add_options --enable-update-packaging
+ac_add_options --disable-tests
+
+export CFLAGS="-gstabs -gfull -save-temps"
+export CXXFLAGS="-gstabs -gfull -save-temps"
+
+# Needed to enable breakpad in application.ini
+export MOZILLA_OFFICIAL=1
new file mode 100644
--- /dev/null
+++ b/mozilla2-staging/master.cfg
@@ -0,0 +1,431 @@
+# -*- 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'] = 9010
+
+
+####### SCHEDULERS, CHANGE SOURCES, AND BUILDERS
+
+HGURL = 'http://hg.mozilla.org/'
+# for nss/nspr
+CVSROOT = ':ext:stgbld@cvs.mozilla.org:/cvsroot'
+CONFIG_REPO_URL = 'http://hg.mozilla.org/build/buildbot-configs'
+CONFIG_SUBDIR = 'mozilla2-staging'
+OBJDIR = 'obj-firefox'
+STAGE_USERNAME = 'ffxbld'
+STAGE_SERVER = 'notstage.mozilla.org'
+STAGE_BASE_PATH = '/home/ftp/pub/firefox'
+STAGE_GROUP = None
+STAGE_SSH_KEY = 'ffxbld_dsa'
+AUS2_USER = 'cltbld'
+AUS2_HOST = 'notaus2-staging.mozilla.org'
+AUS2_BASE_UPLOAD_DIR = '/opt/aus2/build/0/Firefox/mozilla2'
+DOWNLOAD_BASE_URL = 'http://ftp.mozilla.org/pub/mozilla.org/firefox'
+BRANCHES = {'mozilla-central': {}, 'actionmonkey': {}}
+BRANCHES['mozilla-central']['platforms'] = {'linux': {}, 'win32': {}, 'macosx': {}}
+BRANCHES['mozilla-central']['create_snippet'] = True
+BRANCHES['mozilla-central']['upload_symbols'] = True
+BRANCHES['mozilla-central']['platforms']['linux']['slaves'] = ['staging-moz2-linux-slave1']
+BRANCHES['mozilla-central']['platforms']['win32']['slaves'] = ['staging-moz2-win32-slave1']
+BRANCHES['mozilla-central']['platforms']['macosx']['slaves'] = ['staging-moz2-mac-slave1']
+BRANCHES['mozilla-central']['platforms']['linux']['platform_objdir'] = OBJDIR
+BRANCHES['mozilla-central']['platforms']['win32']['platform_objdir'] = OBJDIR
+BRANCHES['mozilla-central']['platforms']['macosx']['platform_objdir'] = '%s/ppc' % OBJDIR
+BRANCHES['mozilla-central']['platforms']['linux']['env'] = {
+    'MOZ_OBJDIR': OBJDIR,
+    'SYMBOL_SERVER_HOST': 'notdm-symbolpush01.mozilla.org',
+    'SYMBOL_SERVER_USER': 'ffxbld',
+    'SYMBOL_SERVER_PATH': '/mnt/netapp/breakpad/symbols_ffx/',
+    'SYMBOL_SERVER_SSH_KEY': "/home/cltbld/.ssh/ffxbld_dsa",
+}
+BRANCHES['mozilla-central']['platforms']['win32']['env'] = {'CVS_RSH': 'ssh',
+    'MOZ_OBJDIR': OBJDIR,
+    'SYMBOL_SERVER_HOST': 'notdm-symbolpush01.mozilla.org',
+    'SYMBOL_SERVER_USER': 'ffxbld',
+    'SYMBOL_SERVER_PATH': '/mnt/netapp/breakpad/symbols_ffx/',
+    'SYMBOL_SERVER_SSH_KEY': "/c/Documents and Settings/cltbld/.ssh/ffxbld_dsa",
+}
+BRANCHES['mozilla-central']['platforms']['macosx']['env'] = {
+    'MOZ_OBJDIR': OBJDIR,
+    'SYMBOL_SERVER_HOST': 'notdm-symbolpush01.mozilla.org',
+    'SYMBOL_SERVER_USER': 'ffxbld',
+    'SYMBOL_SERVER_PATH': '/mnt/netapp/breakpad/symbols_ffx/',
+    'SYMBOL_SERVER_SSH_KEY': "/Users/cltbld/.ssh/ffxbld_dsa",
+}
+BRANCHES['mozilla-central']['platforms']['linux']['update_platform'] = 'Linux_x86-gcc3'
+BRANCHES['mozilla-central']['platforms']['win32']['update_platform'] = 'WINNT_x86-msvc'
+BRANCHES['mozilla-central']['platforms']['macosx']['update_platform'] = 'Darwin_Universal-gcc3'
+BRANCHES['actionmonkey']['platforms'] = {'linux': {}, 'win32': {}, 'macosx': {}}
+BRANCHES['actionmonkey']['create_snippet'] = False
+BRANCHES['actionmonkey']['upload_symbols'] = False
+BRANCHES['actionmonkey']['platforms']['linux']['slaves'] = ['staging-moz2-linux-slave1']
+BRANCHES['actionmonkey']['platforms']['win32']['slaves'] = ['staging-moz2-win32-slave1']
+BRANCHES['actionmonkey']['platforms']['macosx']['slaves'] = ['staging-moz2-mac-slave1']
+BRANCHES['actionmonkey']['platforms']['linux']['platform_objdir'] = OBJDIR
+BRANCHES['actionmonkey']['platforms']['win32']['platform_objdir'] = OBJDIR
+BRANCHES['actionmonkey']['platforms']['macosx']['platform_objdir'] = '%s/ppc' % OBJDIR
+BRANCHES['actionmonkey']['platforms']['linux']['env'] = {
+    'MOZ_OBJDIR': OBJDIR
+}
+BRANCHES['actionmonkey']['platforms']['win32']['env'] = {'CVS_RSH': 'ssh',
+    'MOZ_OBJDIR': OBJDIR
+}
+BRANCHES['actionmonkey']['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.shell import Compile, ShellCommand, WithProperties
+from buildbot.locks import SlaveLock
+
+import buildbotcustom.steps.misc
+import buildbotcustom.steps.transfer
+import buildbotcustom.steps.updates
+reload(buildbotcustom.steps.misc)
+reload(buildbotcustom.steps.transfer)
+reload(buildbotcustom.steps.updates)
+
+from buildbotcustom.steps.misc import SetMozillaBuildProperties
+from buildbotcustom.steps.transfer import MozillaStageUpload
+from buildbotcustom.steps.updates import CreateCompleteUpdateSnippet
+
+c['sources'] = []
+c['schedulers'] = []
+c['builders'] = []
+
+locks = {'linux': SlaveLock(name='linux', maxCount=1),
+         'win32': SlaveLock(name='win32', maxCount=1),
+         'macosx': SlaveLock(name='macosx', maxCount=1)}
+
+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
+    # this one gets triggered by the HG Poller
+#    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
+#    ))
+#    c['schedulers'].append(Periodic(
+#        name='%s periodic' % name,
+#        builderNames=builders,
+#        branch=name,
+#        periodicBuildTimer=60*60*2 # 2 hours
+#    ))
+
+    for platform in branch['platforms'].keys():
+        # shorthand
+        pf = branch['platforms'][platform]
+        mozilla2_dep_factory = factory.BuildFactory()
+        mozilla2_dep_factory.addStep(ShellCommand(
+            command="rm -rfv %s/dist/firefox-* %s/dist/install/sea/*.exe " %
+                     (pf['platform_objdir'], pf['platform_objdir']),
+            env=pf['env'],
+            description=['deleting', 'old', 'package'],
+            descriptionDone=['delete', 'old', 'package']
+        ))
+        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=pf['env'],
+            description=['running', 'client.py'],
+            descriptionDone=['run', 'client.py'],
+            haltOnFailure=True
+        ))
+        mozilla2_dep_factory.addStep(ShellCommand(
+            command=['rm', '-rfv', 'configs'],
+            description=['removing', 'configs'],
+            descriptionDone=['remove', 'configs'],
+            haltOnFailure=True
+        ))
+        mozilla2_dep_factory.addStep(ShellCommand(
+            command=['hg', 'clone', CONFIG_REPO_URL, 'configs'],
+            description=['checking', 'out', 'configs'],
+            descriptionDone=['checkout', 'configs'],
+            haltOnFailure=True
+        ))
+        mozilla2_dep_factory.addStep(ShellCommand(
+            # cp configs/mozilla2/$platform/mozconfig .mozconfig
+            command=['cp', 'configs/%s/%s/mozconfig' % (CONFIG_SUBDIR,
+                                                        platform),
+                     '.mozconfig'],
+            description=['copying', 'mozconfig'],
+            descriptionDone=['copy', 'mozconfig'],
+            haltOnFailure=True
+        ))
+        mozilla2_dep_factory.addStep(ShellCommand(
+            command=['cat', '.mozconfig'],
+        ))
+        mozilla2_dep_factory.addStep(Compile(
+            command=['make', '-f', 'client.mk', 'build'],
+            env=pf['env'],
+            haltOnFailure=True
+        ))
+        mozilla2_dep_factory.addStep(ShellCommand(
+            command=['make', 'package'],
+            workdir='build/%s' % pf['platform_objdir'],
+            haltOnFailure=True
+        ))
+        if platform == "win32":
+            mozilla2_dep_factory.addStep(ShellCommand(
+                command=['make', 'installer'],
+                workdir='build/%s' % pf['platform_objdir'],
+                haltOnFailure=True
+            ))
+        mozilla2_dep_factory.addStep(SetMozillaBuildProperties(
+                objdir='build/%s' % pf['platform_objdir']
+        ))
+#        mozilla2_dep_factory.addStep(MozillaStageUpload(
+#                objdir=pf['platform_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,
+#                tinderboxBuildsDir='%s-%s' % (name, platform),
+#                dependToDated=False
+#        ))
+        # OS X builds eat up a ton of space with -save-temps enabled
+        # until we have dwarf support we need to clean this up so we don't
+        # fill up the disk
+        if platform == "macosx":
+            mozilla2_dep_factory.addStep(ShellCommand(
+                command=['find', '-E', '.', '-iregex',
+                         '.*\.(i|s|mii|ii)$', '-exec', 'rm', '{}', ';'],
+                workdir='build/%s' % OBJDIR
+            ))
+
+
+        mozilla2_dep_builder = {
+            'name': '%s-%s' % (name, platform),
+            'slavenames': pf['slaves'],
+            'builddir': '%s-%s' % (name, platform),
+            'factory': mozilla2_dep_factory,
+            'category': name,
+            'locks': [ locks[platform] ]
+        }
+        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=pf['env'],
+            description=['running', 'client.py'],
+            descriptionDone=['run', 'client.py'],
+            haltOnFailure=True
+        ))
+        mozilla2_nightly_factory.addStep(ShellCommand(
+            command=['rm', '-rfv', 'configs'],
+            description=['removing', 'configs'],
+            descriptionDone=['remove', 'configs'],
+            haltOnFailure=True
+        ))
+        mozilla2_nightly_factory.addStep(ShellCommand(
+            command=['hg', 'clone', CONFIG_REPO_URL, 'configs'],
+            description=['checking', 'out', 'configs'],
+            descriptionDone=['checkout', 'configs'],
+            haltOnFailure=True
+        ))
+        mozilla2_nightly_factory.addStep(ShellCommand(
+            # cp configs/mozilla2/$platform/mozconfig .mozconfig
+            command=['cp', 'configs/%s/%s/mozconfig' % (CONFIG_SUBDIR,
+                                                        platform),
+                     '.mozconfig'],
+            description=['copying', 'mozconfig'],
+            descriptionDone=['copy', 'mozconfig'],
+            haltOnFailure=True
+        ))
+        mozilla2_nightly_factory.addStep(ShellCommand(
+            command=['cat', '.mozconfig'],
+        ))
+        mozilla2_nightly_factory.addStep(Compile(
+            command=['make', '-f', 'client.mk', 'build'],
+            env=pf['env'],
+            haltOnFailure=True
+        ))
+        mozilla2_nightly_factory.addStep(ShellCommand(
+            command=['make', 'package'],
+            workdir='build/%s' % pf['platform_objdir'],
+            haltOnFailure=True
+        ))
+        if platform == "win32":
+            mozilla2_nightly_factory.addStep(ShellCommand(
+                command=['make', 'installer'],
+                workdir='build/%s' % pf['platform_objdir'],
+                haltOnFailure=True
+            ))
+        mozilla2_nightly_factory.addStep(ShellCommand(
+            command=['make', '-C',
+                     '%s/tools/update-packaging' % pf['platform_objdir']],
+            description=['create', 'complete', 'update'],
+            haltOnFailure=True
+        ))
+        mozilla2_nightly_factory.addStep(SetMozillaBuildProperties(
+                objdir='build/%s' % pf['platform_objdir']
+        ))
+#        mozilla2_nightly_factory.addStep(MozillaStageUpload(
+#                objdir=pf['platform_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,
+#                tinderboxBuildsDir='%s-%s' % (name, platform),
+#                dependToDated=False
+#        ))
+        if branch['create_snippet']:
+            # this is a tad ugly because we need to python interpolation
+            # as well as WithProperties
+            # here's an example of what it translates to:
+            # /opt/aus2/build/0/Firefox/mozilla2/WINNT_x86-msvc/2008010103/en-US
+            AUS2_FULL_UPLOAD_DIR = '%s/%s/%%(buildid)s/en-US' % \
+              (AUS2_BASE_UPLOAD_DIR,
+              branch['platforms'][platform]['update_platform']
+              )
+
+            mozilla2_nightly_factory.addStep(CreateCompleteUpdateSnippet(
+                objdir='build/%s' % pf['platform_objdir'],
+                milestone=name,
+                baseurl='%s/nightly' % DOWNLOAD_BASE_URL
+            ))
+#            mozilla2_nightly_factory.addStep(ShellCommand(
+#                command=['ssh', '-l', AUS2_USER, AUS2_HOST,
+#                         WithProperties('mkdir -p %s' % AUS2_FULL_UPLOAD_DIR)],
+#                description=['create', 'aus2', 'upload', 'dir'],
+#                haltOnFailure=True
+#            ))
+#            mozilla2_nightly_factory.addStep(ShellCommand(
+#                command=['scp', '-o', 'User=%s' % AUS2_USER,
+#                         'dist/update/complete.update.snippet',
+#                         WithProperties('%s:%s/complete.txt' % \
+#                           (AUS2_HOST, AUS2_FULL_UPLOAD_DIR))],
+#                workdir='build/%s' % pf['platform_objdir'],
+#                description=['upload', 'complete', 'snippet'],
+#                haltOnFailure=True
+#              ))
+        if branch['upload_symbols']:
+            mozilla2_nightly_factory.addStep(ShellCommand(
+                command=['make', 'buildsymbols'],
+                env=pf['env'],
+                workdir='build/%s' % pf['platform_objdir'],
+                haltOnFailure=True
+            ))
+#            mozilla2_nightly_factory.addStep(ShellCommand(
+#                command=['make', 'uploadsymbols'],
+#                env=pf['env'],
+#                workdir='build/%s' % pf['platform_objdir'],
+#                haltOnFailure=True
+#            ))
+        # OS X builds eat up a ton of space with -save-temps enabled
+        # until we have dwarf support we need to clean this up so we don't
+        # fill up the disk
+        if platform == "macosx":
+            mozilla2_nightly_factory.addStep(ShellCommand(
+                command=['find', '-E', '.', '-iregex',
+                         '.*\.(i|s|mii|ii)$', '-exec', 'rm', '{}', ';'],
+                workdir='build/%s' % OBJDIR
+            ))
+
+
+        mozilla2_nightly_builder = {
+            'name': '%s-%s-nightly' % (name, platform),
+            'slavenames': pf['slaves'],
+            'builddir': '%s-%s-nightly' % (name, platform),
+            'factory': mozilla2_nightly_factory,
+            'category': name,
+            'locks': [ locks[platform] ]
+        }
+        c['builders'].append(mozilla2_nightly_builder)
+
+
+####### STATUS TARGETS
+
+c['status'] = []
+
+from buildbot.status import html
+
+c['status'].append(html.WebStatus(
+    http_port=8010, allowForce=True
+))
+
+
+####### 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'] = "Staging 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/"
new file mode 100644
--- /dev/null
+++ b/mozilla2-staging/public_html/buildbot.css
@@ -0,0 +1,64 @@
+body {
+    background: url("http://www.mozilla.org/images/mozilla-banner.gif") 
+                no-repeat top left;
+    font-family: Verdana, Courier, sans-sarif;
+    font-size: 80%;
+    padding-top: 80px;
+}
+
+a:link, a:visited {
+    color: #000;
+}
+
+td.Event, td.BuildStep, td.Activity, td.Change, td.Time, td.Builder, td.LastBuild {
+    border: 1px solid #777;
+}
+
+td.Event, td.Change, td.Time, td.Builder {
+    background-color: #F3F3F3;
+}
+
+td.green {
+    background-color: #72ff75;
+}
+
+.table {
+    /* border-spacing: 2px; */
+    border-spacing: 0px;
+    width: 1%;
+    border-collapse: seperate;
+}
+
+td {
+    padding: 0.5ex 1ex;
+    text-align: center;
+    border: 1px solid #DDD;
+}
+
+/* Activity states */
+.idle {
+    background-color: #F3F3F3;
+}
+
+/* LastBuild, BuildStep states */
+.success {
+    background-color: #72ff75;
+}
+.failure {
+    background-color: red;
+}
+.warnings {
+    background-color: orange;
+}
+.exception {
+    background-color: #c000c0;
+}
+.start,.running {
+    background-color: yellow;
+}
+
+/* color trunk/branch builder links differently */
+
+.Builder a[href*="trunk"] {
+    color: #05e;
+}
new file mode 100644
--- /dev/null
+++ b/mozilla2-staging/win32/mozconfig
@@ -0,0 +1,9 @@
+ac_add_options --enable-application=browser
+ac_add_options --enable-update-channel=nightly
+ac_add_options --enable-update-packaging
+ac_add_options --enable-jemalloc
+
+export MOZ_DEBUG_SYMBOLS=1
+
+# Needed to enable breakpad in application.ini
+export MOZILLA_OFFICIAL=1