| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 import os | 5 import os |
| 6 import types | 6 import types |
| 7 | 7 |
| 8 from common import cros_chromite | 8 from common import cros_chromite |
| 9 from recipe_engine.config import config_item_context, ConfigGroup | 9 from recipe_engine.config import config_item_context, ConfigGroup |
| 10 from recipe_engine.config import Dict, Single, Set | 10 from recipe_engine.config import Dict, Single, Set |
| 11 | 11 |
| 12 import DEPS | 12 import DEPS |
| 13 path_api = DEPS['path'].api | 13 path_api = DEPS['path'].api |
| 14 | 14 |
| 15 | 15 |
| 16 def BaseConfig(**_kwargs): | 16 def BaseConfig(CBB_CONFIG=None, CBB_BRANCH=None, CBB_BUILD_NUMBER=None, |
| 17 CBB_DEBUG=False, CBB_CLOBBER=False, **_kwargs): |
| 17 return ConfigGroup( | 18 return ConfigGroup( |
| 18 # Base mapping of repository key to repository name. | 19 # Base mapping of repository key to repository name. |
| 19 repositories = Dict(value_type=Set(basestring)), | 20 repositories = Dict(value_type=Set(basestring)), |
| 20 | 21 |
| 21 # Checkout Chromite at this branch. "origin/" will be prepended. | 22 # Checkout Chromite at this branch. "origin/" will be prepended. |
| 22 chromite_branch = Single(basestring), | 23 chromite_branch = Single(basestring, empty_val=CBB_BRANCH or 'master'), |
| 23 | 24 |
| 24 # Should the Chrome version be supplied to cbuildbot? | 25 # Should the Chrome version be supplied to cbuildbot? |
| 25 use_chrome_version = Single(bool), | 26 use_chrome_version = Single(bool), |
| 26 | 27 |
| 27 # Should the CrOS manifest commit message be parsed and added to 'cbuildbot' | 28 # Should the CrOS manifest commit message be parsed and added to 'cbuildbot' |
| 28 # flags? | 29 # flags? |
| 29 read_cros_manifest = Single(bool), | 30 read_cros_manifest = Single(bool), |
| 30 | 31 |
| 31 cbb = ConfigGroup( | 32 cbb = ConfigGroup( |
| 33 # The Chromite configuration to use. |
| 34 config = Single(basestring, empty_val=CBB_CONFIG), |
| 35 |
| 32 # The buildroot directory name to use. | 36 # The buildroot directory name to use. |
| 33 builddir = Single(basestring), | 37 builddir = Single(basestring), |
| 34 | 38 |
| 35 # If supplied, forward to cbuildbot as '--master-build-id'. | 39 # If supplied, forward to cbuildbot as '--master-build-id'. |
| 36 build_id = Single(basestring), | 40 build_id = Single(basestring), |
| 37 | 41 |
| 38 # If supplied, forward to cbuildbot as '--buildnumber'. | 42 # If supplied, forward to cbuildbot as '--buildnumber'. |
| 39 build_number = Single(int), | 43 build_number = Single(int, empty_val=CBB_BUILD_NUMBER), |
| 40 | 44 |
| 41 # If supplied, forward to cbuildbot as '--chrome-rev'. | 45 # If supplied, forward to cbuildbot as '--chrome-rev'. |
| 42 chrome_rev = Single(basestring), | 46 chrome_rev = Single(basestring), |
| 43 | 47 |
| 44 # If supplied, forward to cbuildbot as '--chrome_version'. | 48 # If supplied, forward to cbuildbot as '--chrome_version'. |
| 45 chrome_version = Single(basestring), | 49 chrome_version = Single(basestring), |
| 46 | 50 |
| 47 # If True, add cbuildbot flag: '--debug'. | 51 # If True, add cbuildbot flag: '--debug'. |
| 48 debug = Single(bool), | 52 debug = Single(bool, empty_val=CBB_DEBUG), |
| 49 | 53 |
| 50 # If True, add cbuildbot flag: '--clobber'. | 54 # If True, add cbuildbot flag: '--clobber'. |
| 51 clobber = Single(bool), | 55 clobber = Single(bool, empty_val=CBB_CLOBBER), |
| 52 | 56 |
| 53 # The (optional) configuration repository to use. | 57 # The (optional) configuration repository to use. |
| 54 config_repo = Single(basestring), | 58 config_repo = Single(basestring), |
| 55 ), | 59 ), |
| 60 |
| 61 # A list of branches whose Chromite version is "old". Old Chromite |
| 62 # buildbot commands reside in the "buildbot" subdirectory of the Chromite |
| 63 # repository instead of the "bin". |
| 64 old_chromite_branches = Set(basestring), |
| 65 |
| 66 # A list of branches whose builders should not use a shared buildroot. |
| 67 non_shared_root_branches = Set(basestring), |
| 56 ) | 68 ) |
| 57 | 69 |
| 58 config_ctx = config_item_context(BaseConfig) | 70 config_ctx = config_item_context(BaseConfig) |
| 59 | 71 |
| 60 | 72 |
| 61 @config_ctx() | 73 @config_ctx() |
| 62 def base(c): | 74 def base(c): |
| 63 c.repositories['tryjob'] = [] | 75 c.repositories['tryjob'] = [] |
| 64 c.repositories['chromium'] = [] | 76 c.repositories['chromium'] = [] |
| 65 c.repositories['cros_manifest'] = [] | 77 c.repositories['cros_manifest'] = [] |
| 66 c.chromite_branch = 'master' | 78 |
| 79 c.old_chromite_branches.update(( |
| 80 'firmware-uboot_v2-1299.B', |
| 81 'factory-1412.B', |
| 82 )) |
| 83 c.non_shared_root_branches.update(c.old_chromite_branches) |
| 84 c.non_shared_root_branches.update(( |
| 85 'factory-2305.B', |
| 86 )) |
| 67 | 87 |
| 68 # If running on a testing slave, enable "--debug" so Chromite doesn't cause | 88 # If running on a testing slave, enable "--debug" so Chromite doesn't cause |
| 69 # actual production effects. | 89 # actual production effects. |
| 70 if 'TESTING_MASTER_HOST' in os.environ: # pragma: no cover | 90 if 'TESTING_MASTER_HOST' in os.environ: # pragma: no cover |
| 71 c.cbb.debug = True | 91 c.cbb.debug = True |
| 72 | 92 |
| 73 | 93 |
| 74 @config_ctx(includes=['base']) | 94 @config_ctx(includes=['base']) |
| 75 def external(c): | 95 def external(c): |
| 76 c.repositories['tryjob'].append( | 96 c.repositories['tryjob'].append( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 97 | 117 |
| 98 @config_ctx() | 118 @config_ctx() |
| 99 def chromeos_tryserver_etc(c): | 119 def chromeos_tryserver_etc(c): |
| 100 c.cbb.clobber = True | 120 c.cbb.clobber = True |
| 101 | 121 |
| 102 @config_ctx() | 122 @config_ctx() |
| 103 def chromiumos_coverage_test(c): | 123 def chromiumos_coverage_test(c): |
| 104 c.use_chrome_version = True | 124 c.use_chrome_version = True |
| 105 c.read_cros_manifest = True | 125 c.read_cros_manifest = True |
| 106 c.cbb.chrome_rev = 'stable' | 126 c.cbb.chrome_rev = 'stable' |
| OLD | NEW |