Update cros_mark_as_stable to support working on only private overlays.

BUG=chromium-os:8493
TEST=Ran unit tests. Verified that cros_mark_as_stable.py supports
running on just the private or public overlay.

Change-Id: I5e2e8fc5e63b3c93bb688a5ce87233315c0c2d1c

Review URL: http://codereview.chromium.org/4250001
This commit is contained in:
David James 2010-11-01 16:22:35 -07:00
parent 53320366b5
commit 3d57ef8139
3 changed files with 52 additions and 9 deletions

View File

@ -378,11 +378,20 @@ def _UprevPackages(buildroot, tracking_branch, revisionfile, board):
_UprevAllPackages(buildroot, tracking_branch, board) _UprevAllPackages(buildroot, tracking_branch, board)
def _UprevPush(buildroot, tracking_branch, board): def _UprevPush(buildroot, tracking_branch, board, overlays):
"""Pushes uprev changes to the main line.""" """Pushes uprev changes to the main line."""
cwd = os.path.join(buildroot, 'src', 'scripts') cwd = os.path.join(buildroot, 'src', 'scripts')
public_overlay = '%s/src/third_party/chromiumos-overlay' % buildroot
private_overlay = '%s/src/private-overlays/chromeos-overlay' % buildroot
if overlays == 'private':
overlays = [private_overlay]
elif overlays == 'public':
overlays = [public_overlay]
else:
overlays = [public_overlay, private_overlay]
RunCommand(['./cros_mark_as_stable', '--srcroot=..', RunCommand(['./cros_mark_as_stable', '--srcroot=..',
'--board=%s' % board, '--board=%s' % board,
'--overlays="%s"' % " ".join(overlays),
'--tracking_branch="%s"' % tracking_branch, '--tracking_branch="%s"' % tracking_branch,
'--push_options="--bypass-hooks -f"', 'push'], '--push_options="--bypass-hooks -f"', 'push'],
cwd=cwd) cwd=cwd)
@ -531,7 +540,8 @@ def main():
if buildconfig['master']: if buildconfig['master']:
# Master bot needs to check if the other slaves completed. # Master bot needs to check if the other slaves completed.
if cbuildbot_comm.HaveSlavesCompleted(config): if cbuildbot_comm.HaveSlavesCompleted(config):
_UprevPush(buildroot, tracking_branch, buildconfig['board']) _UprevPush(buildroot, tracking_branch, buildconfig['board'],
buildconfig['overlays'])
else: else:
Die('CBUILDBOT - One of the slaves has failed!!!') Die('CBUILDBOT - One of the slaves has failed!!!')

View File

@ -10,7 +10,7 @@ config_param's:
board -- The board of the image to build. board -- The board of the image to build.
uprev -- Uprevs the local ebuilds to build new changes since last stable. uprev -- Uprevs the local ebuilds to build new changes since last stable.
build. If master then also pushes these changes on success. build. If master then also pushes these changes on success.
master -- Only one allowed to be True. This bot controls the uprev process. master -- This bot pushes changes to the overlays.
important -- Master bot uses important bots to determine overall status. important -- Master bot uses important bots to determine overall status.
i.e. if master bot succeeds and other important slaves succeed i.e. if master bot succeeds and other important slaves succeed
then the master will uprev packages. This should align then the master will uprev packages. This should align
@ -19,7 +19,9 @@ hostname -- Needed for 'important' slaves. The hostname of the bot. Should
match hostname in slaves.cfg in buildbot checkout. match hostname in slaves.cfg in buildbot checkout.
unittests -- Runs unittests for packages. unittests -- Runs unittests for packages.
smoke_bvt -- Runs the test smoke suite in a qemu-based VM using KVM. smoke_bvt -- Runs the test smoke suite in a qemu-based VM using KVM.
overlays -- If this bot is a master bot, select what overlays to push changes
to. This can be 'public', 'private', or 'both'. There should only
be one bot pushing changes to each overlay.
""" """
@ -40,6 +42,32 @@ config['x86-generic-pre-flight-queue'] = {
'hostname' : 'chromeosbuild2', 'hostname' : 'chromeosbuild2',
'unittests' : True, 'unittests' : True,
'smoke_bvt' : True, 'smoke_bvt' : True,
'overlays': 'public',
}
config['x86-mario-pre-flight-queue'] = {
'board' : 'x86-mario',
'uprev' : True,
'master' : True,
'important' : False,
'unittests' : True,
'smoke_bvt' : True,
'overlays': 'private',
}
config['x86_agz_bin'] = {
'board' : 'x86-agz',
'uprev' : True,
'master' : False,
'important' : False,
'unittests' : True,
'smoke_bvt' : True,
}
config['x86_dogfood_bin'] = {
'board' : 'x86-dogfood',
'uprev' : True,
'master' : False,
'important' : False,
'unittests' : True,
'smoke_bvt' : True,
} }
config['x86_pineview_bin'] = { config['x86_pineview_bin'] = {
'board' : 'x86-pineview', 'board' : 'x86-pineview',

View File

@ -21,6 +21,9 @@ from cros_build_lib import Info, RunCommand, Warning, Die
gflags.DEFINE_string('board', '', gflags.DEFINE_string('board', '',
'Board for which the package belongs.', short_name='b') 'Board for which the package belongs.', short_name='b')
gflags.DEFINE_string('overlays', '',
'Space separated list of overlays to modify.',
short_name='o')
gflags.DEFINE_string('packages', '', gflags.DEFINE_string('packages', '',
'Space separated list of packages to mark as stable.', 'Space separated list of packages to mark as stable.',
short_name='p') short_name='p')
@ -479,11 +482,13 @@ def main(argv):
package_list = gflags.FLAGS.packages.split() package_list = gflags.FLAGS.packages.split()
_CheckSaneArguments(package_list, command) _CheckSaneArguments(package_list, command)
if gflags.FLAGS.overlays:
overlays = { overlays = dict((path, []) for path in gflags.FLAGS.overlays.split())
'%s/private-overlays/chromeos-overlay' % gflags.FLAGS.srcroot: [], else:
'%s/third_party/chromiumos-overlay' % gflags.FLAGS.srcroot: [] overlays = {
} '%s/private-overlays/chromeos-overlay' % gflags.FLAGS.srcroot: [],
'%s/third_party/chromiumos-overlay' % gflags.FLAGS.srcroot: []
}
if command == 'commit': if command == 'commit':
_BuildEBuildDictionary(overlays, gflags.FLAGS.all, package_list) _BuildEBuildDictionary(overlays, gflags.FLAGS.all, package_list)