Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Side by Side Diff: bin/cbuildbot.py

Issue 5783001: Add support to pushing unstable changes for the chrome pfq. (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: Fix unittests Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | bin/cros_mark_chrome_as_stable.py » ('j') | bin/cros_mark_chrome_as_stable.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """CBuildbot is wrapper around the build process used by the pre-flight queue""" 7 """CBuildbot is wrapper around the build process used by the pre-flight queue"""
8 8
9 import errno 9 import errno
10 import heapq 10 import heapq
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 cmd = ['./build_packages'] 347 cmd = ['./build_packages']
348 if emptytree: 348 if emptytree:
349 cmd.insert(0, 'EXTRA_BOARD_FLAGS=--emptytree') 349 cmd.insert(0, 'EXTRA_BOARD_FLAGS=--emptytree')
350 350
351 RunCommand(cmd, cwd=cwd, enter_chroot=True) 351 RunCommand(cmd, cwd=cwd, enter_chroot=True)
352 352
353 353
354 def _BuildChrome(buildroot, board, chrome_atom_to_build): 354 def _BuildChrome(buildroot, board, chrome_atom_to_build):
355 """Wrapper for emerge call to build Chrome.""" 355 """Wrapper for emerge call to build Chrome."""
356 cwd = os.path.join(buildroot, 'src', 'scripts') 356 cwd = os.path.join(buildroot, 'src', 'scripts')
357 RunCommand(['emerge-%s' % board, '=%s' % chrome_atom_to_build], 357 RunCommand(['ACCEPT_KEYWORDS="* ~*"', 'emerge-%s' % board,
358 '=%s' % chrome_atom_to_build],
358 cwd=cwd, enter_chroot=True) 359 cwd=cwd, enter_chroot=True)
359 360
360 361
361 def _EnableLocalAccount(buildroot): 362 def _EnableLocalAccount(buildroot):
362 cwd = os.path.join(buildroot, 'src', 'scripts') 363 cwd = os.path.join(buildroot, 'src', 'scripts')
363 # Set local account for test images. 364 # Set local account for test images.
364 RunCommand(['./enable_localaccount.sh', 365 RunCommand(['./enable_localaccount.sh',
365 'chronos'], 366 'chronos'],
366 print_cmd=False, cwd=cwd) 367 print_cmd=False, cwd=cwd)
367 368
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 cmd.extend(['--upload', 'chromeos-images:/var/www/prebuilt/', 573 cmd.extend(['--upload', 'chromeos-images:/var/www/prebuilt/',
573 '--binhost-base-url', 'http://chromeos-prebuilt']) 574 '--binhost-base-url', 'http://chromeos-prebuilt'])
574 575
575 RunCommand(cmd, cwd=cwd) 576 RunCommand(cmd, cwd=cwd)
576 577
577 578
578 def main(): 579 def main():
579 # Parse options 580 # Parse options
580 usage = "usage: %prog [options] cbuildbot_config" 581 usage = "usage: %prog [options] cbuildbot_config"
581 parser = optparse.OptionParser(usage=usage) 582 parser = optparse.OptionParser(usage=usage)
583 parser.add_option('-a', '--acl', default='private',
584 help='ACL to set on GSD archives')
582 parser.add_option('-r', '--buildroot', 585 parser.add_option('-r', '--buildroot',
583 help='root directory where build occurs', default=".") 586 help='root directory where build occurs', default=".")
584 parser.add_option('-n', '--buildnumber', 587 parser.add_option('-n', '--buildnumber',
585 help='build number', type='int', default=0) 588 help='build number', type='int', default=0)
586 parser.add_option('--chrome_rev', default=None, type='string', 589 parser.add_option('--chrome_rev', default=None, type='string',
587 dest='chrome_rev', 590 dest='chrome_rev',
588 help=('Chrome_rev of type [tot|latest_release|' 591 help=('Chrome_rev of type [tot|latest_release|'
589 'sticky_release]')) 592 'sticky_release]'))
590 parser.add_option('-f', '--revisionfile', 593 parser.add_option('-g', '--gsutil', default='', help='Location of gsutil')
591 help='file where new revisions are stored') 594 parser.add_option('-c', '--gsutil_archive', default='',
595 help='Datastore archive location')
592 parser.add_option('--clobber', action='store_true', dest='clobber', 596 parser.add_option('--clobber', action='store_true', dest='clobber',
593 default=False, 597 default=False,
594 help='Clobbers an old checkout before syncing') 598 help='Clobbers an old checkout before syncing')
595 parser.add_option('--debug', action='store_true', dest='debug', 599 parser.add_option('--debug', action='store_true', dest='debug',
596 default=False, 600 default=False,
597 help='Override some options to run as a developer.') 601 help='Override some options to run as a developer.')
602 parser.add_option('--noprebuilts', action='store_false', dest='prebuilts',
603 help="Don't upload prebuilts.")
598 parser.add_option('--nosync', action='store_false', dest='sync', 604 parser.add_option('--nosync', action='store_false', dest='sync',
599 default=True, 605 default=True,
600 help="Don't sync before building.") 606 help="Don't sync before building.")
601 parser.add_option('--notests', action='store_false', dest='tests', 607 parser.add_option('--notests', action='store_false', dest='tests',
602 default=True, 608 default=True,
603 help='Override values from buildconfig and run no tests.') 609 help='Override values from buildconfig and run no tests.')
610 parser.add_option('-f', '--revisionfile',
611 help='file where new revisions are stored')
604 parser.add_option('-t', '--tracking-branch', dest='tracking_branch', 612 parser.add_option('-t', '--tracking-branch', dest='tracking_branch',
605 default='cros/master', help='Run the buildbot on a branch') 613 default='cros/master', help='Run the buildbot on a branch')
606 parser.add_option('-u', '--url', dest='url', 614 parser.add_option('-u', '--url', dest='url',
607 default='http://git.chromium.org/git/manifest', 615 default='http://git.chromium.org/git/manifest',
608 help='Run the buildbot on internal manifest') 616 help='Run the buildbot on internal manifest')
609 parser.add_option('-g', '--gsutil', default='', help='Location of gsutil')
610 parser.add_option('-c', '--gsutil_archive', default='',
611 help='Datastore archive location')
612 parser.add_option('-a', '--acl', default='private',
613 help='ACL to set on GSD archives')
614 617
615 (options, args) = parser.parse_args() 618 (options, args) = parser.parse_args()
616 619
617 buildroot = os.path.abspath(options.buildroot) 620 buildroot = os.path.abspath(options.buildroot)
618 revisionfile = options.revisionfile 621 revisionfile = options.revisionfile
619 tracking_branch = options.tracking_branch 622 tracking_branch = options.tracking_branch
620 chrome_atom_to_build = None 623 chrome_atom_to_build = None
621 624
622 if len(args) >= 1: 625 if len(args) >= 1:
623 buildconfig = _GetConfig(args[-1]) 626 buildconfig = _GetConfig(args[-1])
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 if not os.path.isdir(chroot_path): 663 if not os.path.isdir(chroot_path):
661 _MakeChroot(buildroot) 664 _MakeChroot(buildroot)
662 665
663 if not os.path.isdir(boardpath): 666 if not os.path.isdir(boardpath):
664 _SetupBoard(buildroot, board=buildconfig['board']) 667 _SetupBoard(buildroot, board=buildconfig['board'])
665 668
666 # Perform uprev. If chrome_uprev is set, rev Chrome ebuilds. 669 # Perform uprev. If chrome_uprev is set, rev Chrome ebuilds.
667 if options.chrome_rev: 670 if options.chrome_rev:
668 chrome_atom_to_build = _MarkChromeAsStable(buildroot, tracking_branch, 671 chrome_atom_to_build = _MarkChromeAsStable(buildroot, tracking_branch,
669 options.chrome_rev) 672 options.chrome_rev)
673 # If we found nothing to rev, we're done here.
674 if not chrome_atom_to_build:
675 return
676
670 elif buildconfig['uprev']: 677 elif buildconfig['uprev']:
671 _UprevPackages(buildroot, tracking_branch, revisionfile, 678 _UprevPackages(buildroot, tracking_branch, revisionfile,
672 buildconfig['board'], rev_overlays) 679 buildconfig['board'], rev_overlays)
673 680
674 _EnableLocalAccount(buildroot) 681 _EnableLocalAccount(buildroot)
675 # Doesn't rebuild without acquiring more source. 682 # Doesn't rebuild without acquiring more source.
676 if options.sync: 683 if options.sync:
677 _Build(buildroot, emptytree) 684 _Build(buildroot, emptytree)
678 685
679 if chrome_atom_to_build: 686 if chrome_atom_to_build:
(...skipping 17 matching lines...) Expand all
697 test_results_dir=test_results_dir, 704 test_results_dir=test_results_dir,
698 gsutil=options.gsutil, 705 gsutil=options.gsutil,
699 archive_dir=archive_full_path, 706 archive_dir=archive_full_path,
700 acl=options.acl) 707 acl=options.acl)
701 708
702 if buildconfig['uprev']: 709 if buildconfig['uprev']:
703 # Don't push changes for developers. 710 # Don't push changes for developers.
704 if buildconfig['master']: 711 if buildconfig['master']:
705 # Master bot needs to check if the other slaves completed. 712 # Master bot needs to check if the other slaves completed.
706 if cbuildbot_comm.HaveSlavesCompleted(config): 713 if cbuildbot_comm.HaveSlavesCompleted(config):
707 if not options.debug: 714 if not options.debug and options.prebuilts:
708 _UploadPrebuilts(buildroot, board, buildconfig['rev_overlays'], 715 _UploadPrebuilts(buildroot, board, buildconfig['rev_overlays'],
709 [new_binhost]) 716 [new_binhost])
710 _UprevPush(buildroot, tracking_branch, buildconfig['board'], 717 _UprevPush(buildroot, tracking_branch, buildconfig['board'],
711 push_overlays, options.debug) 718 push_overlays, options.debug)
712 else: 719 else:
713 Die('CBUILDBOT - One of the slaves has failed!!!') 720 Die('CBUILDBOT - One of the slaves has failed!!!')
714 721
715 else: 722 else:
716 # Publish my status to the master if its expecting it. 723 # Publish my status to the master if its expecting it.
717 if buildconfig['important'] and not options.debug: 724 if buildconfig['important'] and not options.debug:
718 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_COMPLETE) 725 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_COMPLETE)
719 726
720 except: 727 except:
721 # Send failure to master bot. 728 # Send failure to master bot.
722 if not buildconfig['master'] and buildconfig['important']: 729 if not buildconfig['master'] and buildconfig['important']:
723 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) 730 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED)
724 731
725 raise 732 raise
726 733
727 734
728 if __name__ == '__main__': 735 if __name__ == '__main__':
729 main() 736 main()
OLDNEW
« no previous file with comments | « no previous file | bin/cros_mark_chrome_as_stable.py » ('j') | bin/cros_mark_chrome_as_stable.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698