mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 15:11:19 +02:00
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:
parent
53320366b5
commit
3d57ef8139
@ -378,11 +378,20 @@ def _UprevPackages(buildroot, tracking_branch, revisionfile, 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."""
|
||||
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=..',
|
||||
'--board=%s' % board,
|
||||
'--overlays="%s"' % " ".join(overlays),
|
||||
'--tracking_branch="%s"' % tracking_branch,
|
||||
'--push_options="--bypass-hooks -f"', 'push'],
|
||||
cwd=cwd)
|
||||
@ -531,7 +540,8 @@ def main():
|
||||
if buildconfig['master']:
|
||||
# Master bot needs to check if the other slaves completed.
|
||||
if cbuildbot_comm.HaveSlavesCompleted(config):
|
||||
_UprevPush(buildroot, tracking_branch, buildconfig['board'])
|
||||
_UprevPush(buildroot, tracking_branch, buildconfig['board'],
|
||||
buildconfig['overlays'])
|
||||
else:
|
||||
Die('CBUILDBOT - One of the slaves has failed!!!')
|
||||
|
||||
|
@ -10,7 +10,7 @@ config_param's:
|
||||
board -- The board of the image to build.
|
||||
uprev -- Uprevs the local ebuilds to build new changes since last stable.
|
||||
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.
|
||||
i.e. if master bot succeeds and other important slaves succeed
|
||||
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.
|
||||
unittests -- Runs unittests for packages.
|
||||
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',
|
||||
'unittests' : 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'] = {
|
||||
'board' : 'x86-pineview',
|
||||
|
@ -21,6 +21,9 @@ from cros_build_lib import Info, RunCommand, Warning, Die
|
||||
|
||||
gflags.DEFINE_string('board', '',
|
||||
'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', '',
|
||||
'Space separated list of packages to mark as stable.',
|
||||
short_name='p')
|
||||
@ -479,7 +482,9 @@ def main(argv):
|
||||
|
||||
package_list = gflags.FLAGS.packages.split()
|
||||
_CheckSaneArguments(package_list, command)
|
||||
|
||||
if gflags.FLAGS.overlays:
|
||||
overlays = dict((path, []) for path in gflags.FLAGS.overlays.split())
|
||||
else:
|
||||
overlays = {
|
||||
'%s/private-overlays/chromeos-overlay' % gflags.FLAGS.srcroot: [],
|
||||
'%s/third_party/chromiumos-overlay' % gflags.FLAGS.srcroot: []
|
||||
|
Loading…
x
Reference in New Issue
Block a user