| OLD | NEW |
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Set of utilities to build the chromium master.""" | 5 """Set of utilities to build the chromium master.""" |
| 6 | 6 |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 | 9 |
| 10 from buildbot.steps import trigger, shell | 10 from buildbot.steps import trigger, shell |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 CHROME_CBUILDBOT_TYPE = 'cbuildbot_chrome' | 50 CHROME_CBUILDBOT_TYPE = 'cbuildbot_chrome' |
| 51 | 51 |
| 52 # Redefining built-in 'type' | 52 # Redefining built-in 'type' |
| 53 # pylint: disable=W0622 | 53 # pylint: disable=W0622 |
| 54 def __init__(self, type=DEFAULT_CBUILDBOT_TYPE, board='x86-generic', | 54 def __init__(self, type=DEFAULT_CBUILDBOT_TYPE, board='x86-generic', |
| 55 buildroot='/b/cbuild', triagelog=None, params='', timeout=9000, | 55 buildroot='/b/cbuild', triagelog=None, params='', timeout=9000, |
| 56 variant=None, is_master=False, branch='master', old_style=False, | 56 variant=None, is_master=False, branch='master', old_style=False, |
| 57 crostools_repo=_default_crostools, | 57 crostools_repo=_default_crostools, |
| 58 chromite_repo=_default_chromite, | 58 chromite_repo=_default_chromite, |
| 59 dry_run=False, chrome_root=None, factory=None, | 59 dry_run=False, chrome_root=None, factory=None, |
| 60 slave_manager=True, chromite_patch=None): | 60 slave_manager=True, chromite_patch=None, trybot=False): |
| 61 self.buildroot = buildroot | 61 self.buildroot = buildroot |
| 62 self.crostools_repo = crostools_repo | 62 self.crostools_repo = crostools_repo |
| 63 self.chromite_repo = chromite_repo | 63 self.chromite_repo = chromite_repo |
| 64 self.chromite_patch = chromite_patch | 64 self.chromite_patch = chromite_patch |
| 65 if chromite_patch: | 65 if chromite_patch: |
| 66 assert ('url' in chromite_patch and 'ref' in chromite_patch) | 66 assert ('url' in chromite_patch and 'ref' in chromite_patch) |
| 67 self.timeout = timeout | 67 self.timeout = timeout |
| 68 self.variant = variant | 68 self.variant = variant |
| 69 self.board = board | 69 self.board = board |
| 70 self.branch = branch | 70 self.branch = branch |
| 71 self.type = type | 71 self.type = type |
| 72 self.is_master = is_master | 72 self.is_master = is_master |
| 73 self.dry_run = dry_run | 73 self.dry_run = dry_run |
| 74 self.chrome_root = chrome_root | 74 self.chrome_root = chrome_root |
| 75 self.slave_manager = slave_manager | 75 self.slave_manager = slave_manager |
| 76 self.trybot = trybot |
| 76 | 77 |
| 77 if factory: | 78 if factory: |
| 78 self.f_cbuild = factory | 79 self.f_cbuild = factory |
| 79 else: | 80 else: |
| 80 self.f_cbuild = chromeos_build_factory.BuildFactory() | 81 self.f_cbuild = chromeos_build_factory.BuildFactory() |
| 81 self.add_boiler_plate_steps() | 82 self.add_boiler_plate_steps() |
| 82 | 83 |
| 83 if type == 'cbuildbot': | 84 if type == 'cbuildbot': |
| 84 description_suffix = '' | 85 description_suffix = '' |
| 85 if self.is_master: | 86 if self.is_master: |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 else: | 233 else: |
| 233 self.f_cbuild.addStep( | 234 self.f_cbuild.addStep( |
| 234 trigger.Trigger(schedulerNames=['pre_flight_queue_slaves'], | 235 trigger.Trigger(schedulerNames=['pre_flight_queue_slaves'], |
| 235 waitForFinish=False)) | 236 waitForFinish=False)) |
| 236 | 237 |
| 237 cbuild_cmd = ['chromite/buildbot/cbuildbot', | 238 cbuild_cmd = ['chromite/buildbot/cbuildbot', |
| 238 shell.WithProperties("--buildnumber=%(buildnumber)s")] | 239 shell.WithProperties("--buildnumber=%(buildnumber)s")] |
| 239 if pass_revision: | 240 if pass_revision: |
| 240 cbuild_cmd.append(shell.WithProperties('--chrome_version=%(revision)s')) | 241 cbuild_cmd.append(shell.WithProperties('--chrome_version=%(revision)s')) |
| 241 | 242 |
| 242 if self._branchAtOrAbove('0.12'): | 243 if self._branchAtOrAbove('0.12') and not self.trybot: |
| 243 cbuild_cmd += ['--buildbot'] | 244 cbuild_cmd += ['--buildbot'] |
| 244 | 245 |
| 245 if self.dry_run: | 246 if self.dry_run: |
| 246 cbuild_cmd += ['--debug'] | 247 cbuild_cmd += ['--debug'] |
| 247 | 248 |
| 248 cbuild_cmd += ['--buildroot=%s' % self.buildroot] | 249 cbuild_cmd += ['--buildroot=%s' % self.buildroot] |
| 249 cbuild_cmd += [('--revisionfile=%s' % | 250 cbuild_cmd += [('--revisionfile=%s' % |
| 250 chromeos_revision_source.PFQ_REVISION_FILE)] | 251 chromeos_revision_source.PFQ_REVISION_FILE)] |
| 251 # Below, WithProperties is appended to cbuild_cmd and rendered into a string | 252 # Below, WithProperties is appended to cbuild_cmd and rendered into a string |
| 252 # for each specific build at build-time. When clobber is None, it renders | 253 # for each specific build at build-time. When clobber is None, it renders |
| 253 # to an empty string. When clobber is not None, it renders to the string | 254 # to an empty string. When clobber is not None, it renders to the string |
| 254 # --clobber. Note: the :+ after clobber controls this behavior and is not | 255 # --clobber. Note: the :+ after clobber controls this behavior and is not |
| 255 # a typo. | 256 # a typo. |
| 256 cbuild_cmd.append(WithProperties('%s', 'clobber:+--clobber')) | 257 cbuild_cmd.append(WithProperties('%s', 'clobber:+--clobber')) |
| 257 | 258 |
| 259 cbuild_cmd.append(WithProperties("--gerrit-patches='%(gerrit_patches)s'")) |
| 260 |
| 258 name = self.type | 261 name = self.type |
| 259 if description_suffix: | 262 if description_suffix: |
| 260 description = '%s_%s' % (name, description_suffix) | 263 description = '%s_%s' % (name, description_suffix) |
| 261 else: | 264 else: |
| 262 description = name | 265 description = name |
| 263 | 266 |
| 264 if self.chrome_root: | 267 if self.chrome_root: |
| 265 cbuild_cmd.append('--chrome_root=%s' % self.chrome_root) | 268 cbuild_cmd.append('--chrome_root=%s' % self.chrome_root) |
| 266 | 269 |
| 267 cbuild_cmd += params.split() | 270 cbuild_cmd += params.split() |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 chromite_patch=chromite_patch) | 377 chromite_patch=chromite_patch) |
| 375 # TODO(sosa): Remove legacy support. | 378 # TODO(sosa): Remove legacy support. |
| 376 if chrome_rev_stages: | 379 if chrome_rev_stages: |
| 377 for chrome_rev in chrome_rev_stages: | 380 for chrome_rev in chrome_rev_stages: |
| 378 bot_params = '--chrome_rev=%s %s' % (chrome_rev, params) | 381 bot_params = '--chrome_rev=%s %s' % (chrome_rev, params) |
| 379 self.cbuildbot_type(bot_params, description_suffix=chrome_rev, | 382 self.cbuildbot_type(bot_params, description_suffix=chrome_rev, |
| 380 pass_revision=pass_revision, haltOnFailure=False) | 383 pass_revision=pass_revision, haltOnFailure=False) |
| 381 else: | 384 else: |
| 382 self.cbuildbot_type(params, haltOnFailure=False, | 385 self.cbuildbot_type(params, haltOnFailure=False, |
| 383 pass_revision=pass_revision) | 386 pass_revision=pass_revision) |
| OLD | NEW |