Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add release master setup builder and config

  • Loading branch information...
commit 8eb9411d029de3f8c7af1c2aa03ccfa44907fb82 1 parent e64aeab
@rail rail authored
View
19 master/master.cfg
@@ -9,13 +9,19 @@ from buildbot.status import html, mail
from buildbot.status.web import auth, authz
from buildbot.changes.pb import PBChangeSource
from buildbot.scheduler import Scheduler
-from buildbot.schedulers.timed import Nightly
+from buildbot.schedulers.timed import Nightly, Periodic
from buildbotcustom.changes.hgpoller import HgPoller
from buildbot.config import BuilderConfig
import preproduction_factory
+import release_master
+import release_config
reload(preproduction_factory)
+reload(release_master)
+reload(release_config)
from preproduction_factory import PPBuildFactory
+from release_master import PPReleaseFactory
+from release_config import rmConfig
config = {}
# TODO: move vars to config.py
@@ -61,6 +67,9 @@ c['schedulers'].append(Nightly(name='weekly',
dayOfWeek=0,
hour=[1],
builderNames=['setup-masters']))
+c['schedulers'].append(Periodic(name='releases',
+ periodicBuildTimer=3*24*60*60, # every 3 days
+ builderNames=['release-master']))
####### BUILDERS
@@ -104,7 +113,13 @@ setup_masters = {'name': 'setup-masters',
'factory': w,
}
-c['builders'] = [test_masters_builder, setup_masters]
+release_factory = PPReleaseFactory(rmConfig=rmConfig)
+release_master = {'name': 'release-master',
+ 'slavename': 'myself',
+ 'builddir': 'release_master',
+ 'factory': release_factory,
+ }
+c['builders'] = [test_masters_builder, setup_masters, release_master]
c['status'] = []
View
14 master/release_config.py
@@ -0,0 +1,14 @@
+rmConfig = {}
+
+# TODO: enable multiple version when we can use locales per version
+rmConfig['releaseConfigs'] = ['mozilla/release-firefox-mozilla-2.0.py']
+rmConfig['releaseMasterDir'] = '/builds/buildbot/release-master'
+rmConfig['releaseMasterHostPort'] = 'localhost:9020'
+
+rmConfig['HG_HOST'] = 'hg.mozilla.org'
+rmConfig['PYTHON'] = '/tools/python/bin/python'
+rmConfig['VIRTUALENV'] = '/tools/python/bin/virtualenv'
+rmConfig['HG_DIR'] = 'users/prepr-ffxbld'
+rmConfig['MASTER_NAME'] = 'preprod-release-master'
+rmConfig['BUILDBOTCUSTOM_BRANCH'] = 'default'
+rmConfig['BUILDBOTCONFIGS_BRANCH'] = 'default'
View
138 master/release_master.py
@@ -0,0 +1,138 @@
+from buildbot.process.factory import BuildFactory
+from buildbot.steps.shell import ShellCommand, SetProperty
+from buildbot.process.properties import WithProperties
+
+from util.hg import make_hg_url
+
+class PPReleaseFactory(BuildFactory):
+
+ def __init__(self, rmConfig, **kwargs):
+ BuildFactory.__init__(self, **kwargs)
+
+ self.addStep(SetProperty(
+ name='set_topdir',
+ command=['pwd'],
+ property='topdir',
+ workdir='.',
+ ))
+ self.addStep(ShellCommand(
+ command=['rm', '-rvf', 'tools', 'buildbot-configs'],
+ workdir='.',
+ ))
+ self.addStep(ShellCommand(
+ command=['hg', 'clone',
+ make_hg_url(rmConfig['HG_HOST'], 'build/tools'),
+ 'tools'],
+ workdir='.',
+ haltOnFailure=True,
+ ))
+ self.addStep(ShellCommand(
+ command=['python', 'scripts/preproduction/repo_setup.py', '-c',
+ 'scripts/preproduction/repo_setup_config.py'],
+ workdir='tools',
+ haltOnFailure=True,
+ ))
+ self.addStep(SetProperty(
+ property='previousSetupMakefile',
+ command='ls %s/Makefile 2>/dev/null || exit 0' %
+ rmConfig['releaseMasterDir'],
+ flunkOnFailure=False,
+ haltOnFailure=False,
+ warnOnFailure=True,
+ ))
+
+ def previousSetupExists(step):
+ return \
+ step.build.getProperties().has_key('previousSetupMakefile') \
+ and len(step.build.getProperty('previousSetupMakefile')) > 0
+
+ self.addStep(ShellCommand(
+ command=['python',
+ 'tools/buildfarm/maintenance/buildbot-wrangler.py',
+ 'stop', '%s/master' % rmConfig['releaseMasterDir']],
+ workdir=rmConfig['releaseMasterDir'],
+ flunkOnFailure=False,
+ doStepIf=previousSetupExists,
+ ))
+ self.addStep(ShellCommand(
+ command=['rm', '-rvf', rmConfig['releaseMasterDir']],
+ workdir='.',
+ haltOnFailure=True,
+ ))
+ self.addStep(ShellCommand(
+ command=['rm', '-rvf', 'buildbot-configs'],
+ workdir='.',
+ haltOnFailure=True,
+ ))
+ self.addStep(ShellCommand(
+ command=['hg', 'clone',
+ make_hg_url(rmConfig['HG_HOST'],
+ '%s/buildbot-configs' % rmConfig['HG_DIR']),
+ 'buildbot-configs'],
+ workdir='.',
+ haltOnFailure=True,
+ ))
+ self.addStep(ShellCommand(
+ command=['make', '-f', 'Makefile.setup',
+ 'PYTHON=%s' % rmConfig['PYTHON'],
+ 'VIRTUALENV=%s' % rmConfig['VIRTUALENV'],
+ 'HG_DIR=%s' % rmConfig['HG_DIR'],
+ 'MASTER_NAME=%s' % rmConfig['MASTER_NAME'],
+ 'BASEDIR=%s' % rmConfig['releaseMasterDir'],
+ 'BUILDBOTCUSTOM_BRANCH=%s' %
+ rmConfig['BUILDBOTCUSTOM_BRANCH'],
+ 'BUILDBOTCONFIGS_BRANCH=%s' %
+ rmConfig['BUILDBOTCONFIGS_BRANCH'],
+ 'virtualenv', 'deps', 'install-buildbot', 'master',
+ 'master-makefile'],
+ workdir='buildbot-configs',
+ env={'PIP_DOWNLOAD_CACHE': WithProperties('%(topdir)s/cache'),
+ 'CC': None,
+ 'CXX': None
+ },
+ haltOnFailure=True,
+ ))
+ self.addStep(ShellCommand(
+ command=['make', 'checkconfig'],
+ workdir=rmConfig['releaseMasterDir'],
+ haltOnFailure=True,
+ ))
+ self.addStep(ShellCommand(
+ command=['touch', 'twistd.log'],
+ workdir='%s/master' % rmConfig['releaseMasterDir'],
+ ))
+ self.addStep(ShellCommand(
+ command=['python',
+ 'tools/buildfarm/maintenance/buildbot-wrangler.py',
+ 'start', '%s/master' % rmConfig['releaseMasterDir']],
+ workdir=rmConfig['releaseMasterDir'],
+ ))
+ for release_config in rmConfig['releaseConfigs']:
+ self.addStep(SetProperty(
+ property='release_tag',
+ command=['python', '-c',
+ 'execfile("%s"); \
+ print releaseConfig["baseTag"] + "_RELEASE"' %
+ release_config],
+ workdir='%s/buildbot-configs' % rmConfig['releaseMasterDir'],
+ ))
+ self.addStep(SetProperty(
+ property='release_branch',
+ command=['python', '-c',
+ 'execfile("%s"); \
+ print releaseConfig["sourceRepositories"]["mozilla"]["path"]' %
+ release_config],
+ workdir='%s/buildbot-configs' % rmConfig['releaseMasterDir'],
+ ))
+
+ self.addStep(ShellCommand(
+ command=['buildbot', 'sendchange',
+ '--username', 'preproduction',
+ '--master', rmConfig['releaseMasterHostPort'],
+ '--branch', WithProperties('%(release_branch)s'),
+ '-p', 'release_config:%s' % release_config,
+ '-p', WithProperties(
+ 'script_repo_revision:%(release_tag)s'),
+ 'release_build'],
+ workdir='.',
+ ))
Please sign in to comment.
Something went wrong with that request. Please try again.