# -*- python -*- # ex: set syntax=python: # This is a buildmaster config file for Mozilla Firefox nightly builds. # It must be installed as 'master.cfg' in your buildmaster's base directory # (although the filename can be changed with the --basedir option to # 'mktap buildbot master'). # It has one job: define a dictionary named BuildmasterConfig. This # dictionary has a variety of keys to control different aspects of the # buildmaster. They are documented in docs/config.xhtml . # This is the dictionary that the buildmaster pays attention to. We also use # a shorter alias to save typing. c = BuildmasterConfig = {} # Mozilla specific config ####### BUILDSLAVES # the 'bots' list defines the set of allowable buildslaves. Each element is a # tuple of bot-name and bot-password. These correspond to values given to the # buildslave's mktap invocation. from buildbot.buildslave import BuildSlave c['slaves'] = [ BuildSlave( 'linux-trunk-1', 'mozilla', notify_on_missing='robert@roberthelmer.com', missing_timeout=300, ), BuildSlave( 'macosx-trunk-1', 'mozilla', notify_on_missing='robert@roberthelmer.com', missing_timeout=300, ), BuildSlave( 'win32-trunk-1', 'mozilla', notify_on_missing='robert@roberthelmer.com', missing_timeout=300, ), ] # 'slavePortnum' defines the TCP port to listen on. This must match the value # configured into the buildslaves (with their --master option) c['slavePortnum'] = 9989 ####### CHANGESOURCES # the 'sources' list tells the buildmaster how it should find out about # source code changes. Any class which implements IChangeSource can be added # to this list: there are several in buildbot/changes/*.py to choose from. c['sources'] = [] # For example, if you had CVSToys installed on your repository, and your # CVSROOT/freshcfg file had an entry like this: #pb = ConfigurationSet([ # (None, None, None, PBService(userpass=('foo', 'bar'), port=4519)), # ]) # then you could use the following buildmaster Change Source to subscribe to # the FreshCVS daemon and be notified on every commit: # #from buildbot.changes.freshcvs import FreshCVSSource #fc_source = FreshCVSSource("cvs.example.com", 4519, "foo", "bar") #c['sources'].append(fc_source) # or, use a PBChangeSource, and then have your repository's commit script run # 'buildbot sendchange', or contrib/svn_buildbot.py, or # contrib/arch_buildbot.py : # from buildbot.changes import bonsaipoller from buildbot.changes.pb import PBChangeSource c['sources'].append( bonsaipoller.BonsaiPoller( bonsaiURL = 'http://bonsai.mozilla.org', module = 'PhoenixTinderbox', branch = 'HEAD', pollInterval = 60, ) ) # for sendchange c['sources'].append(PBChangeSource()) ####### SCHEDULERS ## configure the Schedulers from buildbot.scheduler import Scheduler from buildbot.scheduler import Dependent # Mozilla-specific settings MOZ_PATH='/home/buildmaster/public_html/uploads' cvsroot = ":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot" c['schedulers'] = [] build_scheduler = Scheduler( name="build", treeStableTimer=0, branch = 'HEAD', builderNames=["linux", "macosx", "win32"], ) c['schedulers'].append(build_scheduler) ####### BUILDERS # the 'builders' list defines the Builders. Each one is configured with a # dictionary, using the following keys: # name (required): the name used to describe this bilder # slavename (required): which slave to use, must appear in c['bots'] # builddir (required): which subdirectory to run the builder in # factory (required): a BuildFactory to define how the build is run # periodicBuildTime (optional): if set, force a build every N seconds # buildbot/process/factory.py provides several BuildFactory classes you can # start with, which implement build processes for common targets (GNU # autoconf projects, CPAN perl modules, etc). The factory.BuildFactory is the # base class, and is configured with a series of BuildSteps. When the build # is run, the appropriate buildslave is told to execute each Step in turn. # the first BuildStep is typically responsible for obtaining a copy of the # sources. There are source-obtaining Steps in buildbot/process/step.py for # CVS, SVN, and others. c['builders'] = [] from buildbot.process import factory from buildbot.steps.shell import ShellCommand, Configure, Compile, WithProperties buildFactory = factory.BuildFactory() buildFactory.addStep(ShellCommand, description='download mozconfig', command=[ 'scp', '-oPort=2222', WithProperties("buildmaster@roberthelmer.com:buildbot-configs/mozconfig-%(buildername)s"), './.mozconfig', ], workdir='mozilla', haltOnFailure=1, ) # FIXME need Source step here buildFactory.addStep(ShellCommand, description="check out client.mk", command=['cvs', '-d', cvsroot, 'co', 'mozilla/client.mk'], workdir=".", haltOnFailure=1, ) buildFactory.addStep(ShellCommand, description="check out project", command=['make', '-f', 'client.mk', 'checkout'], workdir="mozilla", haltOnFailure=1, ) buildFactory.addStep(Configure, command=['make', '-f', 'client.mk', 'configure'], workdir='mozilla', haltOnFailure=1, ) buildFactory.addStep(Compile, command=['make', '-f', 'client.mk', 'build'], workdir='mozilla', env={'MOZILLA_OFFICIAL':'1'}, haltOnFailure=1, ) buildFactory.addStep(ShellCommand, description='build symbols', command=['make', 'buildsymbols'], workdir='mozilla', haltOnFailure=1, ) # FIXME should be done by "make uploadsymbols" target from email.Utils import parsedate buildFactory.addStep(ShellCommand, description='create upload dir', command=[ 'ssh', '-p2222', 'buildmaster@roberthelmer.com', 'mkdir -p ' + MOZ_PATH + '/symbols', ], workdir='mozilla', haltOnFailure=1, ) buildFactory.addStep(ShellCommand, description='upload symbols', command=['make', 'uploadsymbols', 'SYMBOL_SERVER_HOST=roberthelmer.com', 'SYMBOL_SERVER_USER=buildmaster', 'SYMBOL_SERVER_PATH='+MOZ_PATH + '/symbols', 'SYMBOL_SERVER_PORT=2222', ], workdir='mozilla', haltOnFailure=1, ) buildFactory.addStep(ShellCommand, description='make package', command=['make', 'package'], workdir='mozilla', haltOnFailure=1, ) # FIXME hardcoded build path # FIXME should create "make uploadpackage" target.. buildFactory.addStep(ShellCommand, description='upload build', command=['bash', '-c', 'scp -oPort=2222 firefox-* buildmaster@roberthelmer.com:' + MOZ_PATH], workdir='mozilla/dist', haltOnFailure=1, ) buildFactory.addStep(ShellCommand, description='create complete update', command='make -C tools/update-packaging', workdir='mozilla', haltOnFailure=1, ) # FIXME hardcoded MAR path # FIXME should create "make uploadmar" target.. buildFactory.addStep(ShellCommand, description='upload complete update', command=['bash', '-c', 'scp -oPort=2222 firefox-* buildmaster@roberthelmer.com:'+MOZ_PATH], workdir='mozilla/dist/update', haltOnFailure=1, ) # FIXME hardcoded cvsroot buildFactory.addStep(ShellCommand, description='checkout l10n', command=['cvs', '-d', ':pserver:anonymous@cvs-mirror.mozilla.org:/l10n', 'co', 'l10n'], workdir='.', haltOnFailure=1, ) # FIXME hardcoded project name # FIXME hardcoded paths # FIXME should create "make l10n" target.. buildFactory.addStep(ShellCommand, description='build l10n', command=['bash', '-c', 'for locale in `cat browser/locales/all-locales`; do make -C browser/locales/ installers-${locale} && ln -s `pwd`/dist/host dist/l10n-stage/host && make -C tools/update-packaging full-update DIST=`pwd`/dist/l10n-stage AB_CD=${locale} && cp dist/l10n-stage/update/* dist/update/; done'], workdir='mozilla', warnOnFailure=1, ) ## FIXME hardcoded l10n paths ## FIXME should create "make uploadl10n" target.. buildFactory.addStep(ShellCommand, description='upload l10n', command=['bash', '-c', 'scp -oPort=2222 firefox-* buildmaster@roberthelmer.com:'+MOZ_PATH], workdir='mozilla/dist', haltOnFailure=1, ) # FIXME hardcoded langpack path # FIXME should create "make uploadlangpacks" target.. buildFactory.addStep(ShellCommand, description='upload l10n language packs', command=['bash', '-c', 'scp -oPort=2222 firefox-*.xpi buildmaster@roberthelmer.com:'+MOZ_PATH], workdir='mozilla/dist/install', haltOnFailure=1, ) # FIXME should only run on clobber, so clean should not be necessary buildFactory.addStep(ShellCommand, description='clean partial updates', command=['bash', '-c', 'if [ -f *.partial.mar ]; then rm *.partial.mar; fi'], workdir='mozilla/dist/update', haltOnFailure=1, ) # FIXME should be in tools/update-packaging buildFactory.addStep(ShellCommand, description='clean partial update scripts', command=['bash', '-c', 'if [ -f scripts ]; then rm -rf scripts; fi'], workdir='mozilla/dist/update', haltOnFailure=1, ) # FIXME should be in tools/update-packaging buildFactory.addStep(ShellCommand, description='checkout partial update scripts', command=['svn', 'co', 'http://roberthelmer.com/svn/scripts'], workdir='mozilla/dist/update', haltOnFailure=1, ) # FIXME should be a makefile target buildFactory.addStep(ShellCommand, description='create partial updates', command=['python','scripts/trunk/nightly_partials.py','-n','.','-o','old'], workdir='mozilla/dist/update', haltOnFailure=1, ) # FIXME hardcoded MAR path # FIXME should create "make uploadmar" target.. buildFactory.addStep(ShellCommand, description='upload complete update', command=['bash', '-c', 'scp -oPort=2222 firefox-* buildmaster@roberthelmer.com:'+MOZ_PATH], workdir='mozilla/dist/update', haltOnFailure=1, ) c['builders'].append({ 'name': 'linux', 'slavename': 'linux-trunk-1', 'builddir': 'linux', 'factory': buildFactory, }) c['builders'].append({ 'name': 'win32', 'slavename': 'win32-trunk-1', 'builddir': 'win32', 'factory': buildFactory, }) c['builders'].append({ 'name': 'macosx', 'slavename': 'macosx-trunk-1', 'builddir': 'macosx', 'factory': buildFactory, }) ####### STATUS TARGETS # 'status' is a list of Status Targets. The results of each build will be # pushed to these targets. buildbot/status/*.py has a variety to choose from, # including web pages, email senders, and IRC bots. c['status'] = [] from buildbot.status import html c['status'].append( html.Waterfall( http_port=8810, css='/home/buildmaster/mozilla.css', allowForce=True, ) ) from buildbot.status import mail c['status'].append( mail.MailNotifier( fromaddr="buildbot@roberthelmer.com", ) ) # from buildbot.status import words # c['status'].append(words.IRC(host="irc.example.com", nick="bb", # channels=["#example"])) # # from buildbot.status import client # c['status'].append(client.PBListener(9988)) ####### DEBUGGING OPTIONS # if you set 'debugPassword', then you can connect to the buildmaster with # the diagnostic tool in contrib/debugclient.py . From this tool, you can # manually force builds and inject changes, which may be useful for testing # your buildmaster without actually commiting changes to your repository (or # before you have a functioning 'sources' set up). The debug tool uses the # same port number as the slaves do: 'slavePortnum'. #c['debugPassword'] = "debugpassword" # if you set 'manhole', you can ssh into the buildmaster and get an # interactive python shell, which may be useful for debugging buildbot # internals. It is probably only useful for buildbot developers. You can also # use an authorized_keys file, or plain telnet. #from buildbot import manhole #c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1", # "admin", "password") ####### 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'] = "Nightly Dev" c['projectURL'] = "http://www.mozilla.org/" # 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://buildbot.roberthelmer.com:8810"