mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 15:11:19 +02:00
Add buildbot functionality to cbuildbot.
Change-Id: I1291d2f52122fe345c5927a7ef27e20d07e917d7 BUG=chromium-os:11229 TEST=(building locally, still in progress) Review URL: http://codereview.chromium.org/6317014
This commit is contained in:
parent
f2ee5f6871
commit
91c39378e0
@ -485,6 +485,42 @@ def _UprevPush(buildroot, tracking_branch, board, overlays, dryrun):
|
|||||||
RunCommand(cmd, cwd=cwd)
|
RunCommand(cmd, cwd=cwd)
|
||||||
|
|
||||||
|
|
||||||
|
def _LegacyArchiveBuild(bot_id, buildconfig, buildnumber, debug=False):
|
||||||
|
"""Adds a step to the factory to archive a build."""
|
||||||
|
|
||||||
|
# Fixed properties
|
||||||
|
keep_max = 3
|
||||||
|
gsutil_archive = 'gs://chromeos-archive/' + bot_id
|
||||||
|
|
||||||
|
cmd = ['./archive_build.sh',
|
||||||
|
'--build_number', str(buildnumber),
|
||||||
|
'--to', '/var/www/archive/' + bot_id,
|
||||||
|
'--keep_max', str(keep_max),
|
||||||
|
'--prebuilt_upload',
|
||||||
|
'--board', buildconfig['board'],
|
||||||
|
|
||||||
|
'--acl', '/home/chrome-bot/slave_archive_acl',
|
||||||
|
'--gsutil_archive', gsutil_archive,
|
||||||
|
'--gsd_gen_index',
|
||||||
|
'/b/scripts/gsd_generate_index/gsd_generate_index.py',
|
||||||
|
'--gsutil', '/b/scripts/slave/gsutil',
|
||||||
|
'--test_mod'
|
||||||
|
]
|
||||||
|
|
||||||
|
if buildconfig.get('test_mod', True):
|
||||||
|
cmd.append('--test_mod')
|
||||||
|
|
||||||
|
if buildconfig.get('factory_install_mod', True):
|
||||||
|
cmd.append('--factory_install_mod')
|
||||||
|
|
||||||
|
if buildconfig.get('factory_test_mod', True):
|
||||||
|
cmd.append('--factory_test_mod')
|
||||||
|
|
||||||
|
if debug:
|
||||||
|
Warning('***** ***** LegacyArchiveBuild CMD: ' + ' '.join(cmd))
|
||||||
|
else:
|
||||||
|
RunCommand(cmd)
|
||||||
|
|
||||||
def _ArchiveTestResults(buildroot, board, test_results_dir,
|
def _ArchiveTestResults(buildroot, board, test_results_dir,
|
||||||
gsutil, archive_dir, acl):
|
gsutil, archive_dir, acl):
|
||||||
"""Archives the test results into Google Storage
|
"""Archives the test results into Google Storage
|
||||||
@ -608,6 +644,8 @@ def main():
|
|||||||
parser = optparse.OptionParser(usage=usage)
|
parser = optparse.OptionParser(usage=usage)
|
||||||
parser.add_option('-a', '--acl', default='private',
|
parser.add_option('-a', '--acl', default='private',
|
||||||
help='ACL to set on GSD archives')
|
help='ACL to set on GSD archives')
|
||||||
|
parser.add_option('--archive_build', action='store_true', default=False,
|
||||||
|
help='Run the archive_build script.')
|
||||||
parser.add_option('-r', '--buildroot',
|
parser.add_option('-r', '--buildroot',
|
||||||
help='root directory where build occurs', default=".")
|
help='root directory where build occurs', default=".")
|
||||||
parser.add_option('-n', '--buildnumber',
|
parser.add_option('-n', '--buildnumber',
|
||||||
@ -625,6 +663,9 @@ def main():
|
|||||||
parser.add_option('--debug', action='store_true', dest='debug',
|
parser.add_option('--debug', action='store_true', dest='debug',
|
||||||
default=False,
|
default=False,
|
||||||
help='Override some options to run as a developer.')
|
help='Override some options to run as a developer.')
|
||||||
|
parser.add_option('--nobuild', action='store_false', dest='build',
|
||||||
|
default=True,
|
||||||
|
help="Don't actually build (for cbuildbot dev")
|
||||||
parser.add_option('--noprebuilts', action='store_false', dest='prebuilts',
|
parser.add_option('--noprebuilts', action='store_false', dest='prebuilts',
|
||||||
default=True,
|
default=True,
|
||||||
help="Don't upload prebuilts.")
|
help="Don't upload prebuilts.")
|
||||||
@ -650,7 +691,8 @@ def main():
|
|||||||
chrome_atom_to_build = None
|
chrome_atom_to_build = None
|
||||||
|
|
||||||
if len(args) >= 1:
|
if len(args) >= 1:
|
||||||
buildconfig = _GetConfig(args[-1])
|
bot_id = args[-1]
|
||||||
|
buildconfig = _GetConfig(bot_id)
|
||||||
else:
|
else:
|
||||||
Warning('Missing configuration description')
|
Warning('Missing configuration description')
|
||||||
parser.print_usage()
|
parser.print_usage()
|
||||||
@ -706,6 +748,8 @@ def main():
|
|||||||
buildconfig['board'], rev_overlays)
|
buildconfig['board'], rev_overlays)
|
||||||
|
|
||||||
_EnableLocalAccount(buildroot)
|
_EnableLocalAccount(buildroot)
|
||||||
|
|
||||||
|
if options.build:
|
||||||
_Build(buildroot, emptytree)
|
_Build(buildroot, emptytree)
|
||||||
|
|
||||||
if buildconfig['unittests'] and options.tests:
|
if buildconfig['unittests'] and options.tests:
|
||||||
@ -747,6 +791,11 @@ def main():
|
|||||||
if buildconfig['important'] and not options.debug:
|
if buildconfig['important'] and not options.debug:
|
||||||
cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_COMPLETE)
|
cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_COMPLETE)
|
||||||
|
|
||||||
|
if options.archive_build:
|
||||||
|
_LegacyArchiveBuild(bot_id,
|
||||||
|
buildconfig,
|
||||||
|
options.buildnumber,
|
||||||
|
options.debug)
|
||||||
except:
|
except:
|
||||||
# Send failure to master bot.
|
# Send failure to master bot.
|
||||||
if not buildconfig['master'] and buildconfig['important']:
|
if not buildconfig['master'] and buildconfig['important']:
|
||||||
|
@ -25,6 +25,9 @@ push_overlays -- Select what overlays to push at. This should be a subset of
|
|||||||
rev_overlays for the particular builder. Must be None if
|
rev_overlays for the particular builder. Must be None if
|
||||||
not a master. There should only be one master bot pushing
|
not a master. There should only be one master bot pushing
|
||||||
changes to each overlay per branch.
|
changes to each overlay per branch.
|
||||||
|
test_mod -- Create a test mod image. (default True)
|
||||||
|
factory_install_mod -- Create a factory install image. (default True)
|
||||||
|
factory_test_mod -- Create a factory test image. (default True)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@ -107,6 +110,8 @@ config['arm_tegra2_bin'] = {
|
|||||||
'unittests' : False,
|
'unittests' : False,
|
||||||
'rev_overlays': 'public',
|
'rev_overlays': 'public',
|
||||||
'push_overlays': None,
|
'push_overlays': None,
|
||||||
|
'factory_install_mod' : False,
|
||||||
|
'factory_test_mod' : False,
|
||||||
}
|
}
|
||||||
config['arm_generic_bin'] = {
|
config['arm_generic_bin'] = {
|
||||||
'board' : 'arm-generic',
|
'board' : 'arm-generic',
|
||||||
@ -116,4 +121,6 @@ config['arm_generic_bin'] = {
|
|||||||
'unittests' : False,
|
'unittests' : False,
|
||||||
'rev_overlays': 'public',
|
'rev_overlays': 'public',
|
||||||
'push_overlays': None,
|
'push_overlays': None,
|
||||||
|
'factory_install_mod' : False,
|
||||||
|
'factory_test_mod' : False,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user