| 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 recipe_engine.config import config_item_context, ConfigGroup | 8 from recipe_engine.config import config_item_context, ConfigGroup |
| 9 from recipe_engine.config import Dict, Single, Set | 9 from recipe_engine.config import Dict, Single, Set |
| 10 | 10 |
| 11 import DEPS | |
| 12 path_api = DEPS['path'].api | |
| 13 | |
| 14 | 11 |
| 15 def BaseConfig(CBB_CONFIG=None, CBB_BRANCH=None, CBB_BUILD_NUMBER=None, | 12 def BaseConfig(CBB_CONFIG=None, CBB_BRANCH=None, CBB_BUILD_NUMBER=None, |
| 16 CBB_DEBUG=False, CBB_CLOBBER=False, CBB_BUILDBUCKET_ID=None, | 13 CBB_DEBUG=False, CBB_CLOBBER=False, CBB_BUILDBUCKET_ID=None, |
| 17 **_kwargs): | 14 **_kwargs): |
| 18 return ConfigGroup( | 15 return ConfigGroup( |
| 19 # Base mapping of repository key to repository name. | 16 # Base mapping of repository key to repository name. |
| 20 repositories = Dict(value_type=Set(basestring)), | 17 repositories = Dict(value_type=Set(basestring)), |
| 21 | 18 |
| 22 # Checkout Chromite at this branch. "origin/" will be prepended. | 19 # Checkout Chromite at this branch. "origin/" will be prepended. |
| 23 chromite_branch = Single(basestring, empty_val=CBB_BRANCH or 'master'), | 20 chromite_branch = Single(basestring, empty_val=CBB_BRANCH or 'master'), |
| 24 | 21 |
| 25 # Should the Chrome version be supplied to cbuildbot? | 22 # Should the Chrome version be supplied to cbuildbot? |
| 26 use_chrome_version = Single(bool), | 23 use_chrome_version = Single(bool), |
| 27 | 24 |
| 28 # Should the CrOS manifest commit message be parsed and added to 'cbuildbot' | 25 # Should the CrOS manifest commit message be parsed and added to 'cbuildbot' |
| 29 # flags? | 26 # flags? |
| 30 read_cros_manifest = Single(bool), | 27 read_cros_manifest = Single(bool), |
| 31 | 28 |
| 29 # The current configuration's "build_type". If not populated, it will be |
| 30 # loaded by looking up the current configuration in the configuration |
| 31 # dump JSON. |
| 32 build_type = Single(basestring), |
| 33 |
| 34 # A map of "build_type" values to the specialized "config" names to apply |
| 35 # for those build types. This allows build and invocation specialization |
| 36 # based on build type. |
| 37 # |
| 38 # This gets applied after the specified Chromite repository is checked out. |
| 39 build_type_configs = Dict(value_type=basestring), |
| 40 |
| 41 # cbuildbot tool flags. |
| 32 cbb = ConfigGroup( | 42 cbb = ConfigGroup( |
| 33 # The Chromite configuration to use. | 43 # The Chromite configuration to use. |
| 34 config = Single(basestring, empty_val=CBB_CONFIG), | 44 config = Single(basestring, empty_val=CBB_CONFIG), |
| 35 | 45 |
| 36 # The buildroot directory name to use. | 46 # The buildroot directory name to use. |
| 37 builddir = Single(basestring), | 47 builddir = Single(basestring), |
| 38 | 48 |
| 39 # If supplied, forward to cbuildbot as '--master-build-id'. | 49 # If supplied, forward to cbuildbot as '--master-build-id'. |
| 40 build_id = Single(basestring), | 50 build_id = Single(basestring), |
| 41 | 51 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 101 |
| 92 @config_ctx() | 102 @config_ctx() |
| 93 def base(c): | 103 def base(c): |
| 94 c.repositories['tryjob'] = [] | 104 c.repositories['tryjob'] = [] |
| 95 c.repositories['chromium'] = [] | 105 c.repositories['chromium'] = [] |
| 96 c.repositories['cros_manifest'] = [] | 106 c.repositories['cros_manifest'] = [] |
| 97 c.repo_cache_dir = '/var/cache/chrome-infra/ccompute-setup/cros-internal' | 107 c.repo_cache_dir = '/var/cache/chrome-infra/ccompute-setup/cros-internal' |
| 98 | 108 |
| 99 c.old_chromite_branches.update(( | 109 c.old_chromite_branches.update(( |
| 100 'firmware-uboot_v2-1299.B', | 110 'firmware-uboot_v2-1299.B', |
| 111 # TODO(dnj): Remove this once internal expectations are updated. |
| 101 'factory-1412.B', | 112 'factory-1412.B', |
| 102 )) | 113 )) |
| 103 c.non_shared_root_branches.update(c.old_chromite_branches) | 114 c.non_shared_root_branches.update(c.old_chromite_branches) |
| 104 c.non_shared_root_branches.update(( | 115 c.non_shared_root_branches.update(( |
| 105 'factory-2305.B', | 116 'factory-2305.B', |
| 106 )) | 117 )) |
| 107 c.chrome_svn_branches.update(( | 118 c.chrome_svn_branches.update(( |
| 119 # TODO(dnj): Remove this once internal expectations are updated. |
| 108 'factory-4455.B', | 120 'factory-4455.B', |
| 121 # TODO(dnj): Remove this once internal expectations are updated. |
| 109 'factory-zako-5220.B', | 122 'factory-zako-5220.B', |
| 123 |
| 110 'factory-rambi-5517.B', | 124 'factory-rambi-5517.B', |
| 111 'factory-nyan-5772.B', | 125 'factory-nyan-5772.B', |
| 112 )) | 126 )) |
| 113 | 127 |
| 114 | |
| 115 # If running on a testing slave, enable "--debug" so Chromite doesn't cause | 128 # If running on a testing slave, enable "--debug" so Chromite doesn't cause |
| 116 # actual production effects. | 129 # actual production effects. |
| 117 if 'TESTING_MASTER_HOST' in os.environ: # pragma: no cover | 130 if 'TESTING_MASTER_HOST' in os.environ: # pragma: no cover |
| 118 c.cbb.debug = True | 131 c.cbb.debug = True |
| 119 | 132 |
| 120 | 133 |
| 121 @config_ctx(includes=['base']) | 134 @config_ctx(includes=['base']) |
| 122 def external(c): | 135 def external(c): |
| 123 c.repositories['tryjob'].extend([ | 136 c.repositories['tryjob'].extend([ |
| 124 'https://chromium.googlesource.com/chromiumos/tryjobs', | 137 'https://chromium.googlesource.com/chromiumos/tryjobs', |
| 125 'https://chrome-internal.googlesource.com/chromeos/tryjobs', | 138 'https://chrome-internal.googlesource.com/chromeos/tryjobs', |
| 126 ]) | 139 ]) |
| 127 c.repositories['chromium'].append( | 140 c.repositories['chromium'].append( |
| 128 'https://chromium.googlesource.com/chromium/src') | 141 'https://chromium.googlesource.com/chromium/src') |
| 129 c.repositories['cros_manifest'].append( | 142 c.repositories['cros_manifest'].append( |
| 130 'https://chromium.googlesource.com/chromiumos/manifest-versions') | 143 'https://chromium.googlesource.com/chromiumos/manifest-versions') |
| 131 | 144 |
| 132 | 145 |
| 133 @config_ctx(group='master', includes=['external']) | 146 @config_ctx(group='master', includes=['external']) |
| 134 def master_chromiumos_chromium(c): | 147 def master_chromiumos_chromium(c): |
| 135 c.use_chrome_version = True | 148 c.use_chrome_version = True |
| 136 c.cbb.builddir = 'shared_external' | 149 c.cbb.builddir = 'shared_external' |
| 137 | 150 |
| 138 | 151 |
| 139 @config_ctx(group='master', includes=['external']) | 152 @config_ctx(group='master', includes=['external']) |
| 140 def master_chromiumos(c): | 153 def master_chromiumos(c): |
| 141 c.cbb.builddir = 'external_master' | 154 c.cbb.builddir = 'external_master' |
| 142 c.cbb.supports_repo_cache = True | 155 c.cbb.supports_repo_cache = True |
| 143 | 156 |
| 144 @config_ctx() | 157 |
| 158 @config_ctx(group='build_type') |
| 145 def chromiumos_paladin(c): | 159 def chromiumos_paladin(c): |
| 146 c.read_cros_manifest = True | 160 c.read_cros_manifest = True |
| 147 | 161 |
| 162 |
| 148 @config_ctx(group='master', includes=['external']) | 163 @config_ctx(group='master', includes=['external']) |
| 149 def chromiumos_tryserver(c): | 164 def master_chromiumos_tryserver(c): |
| 150 c.cbb.disable_bootstrap = True | 165 c.cbb.disable_bootstrap = True |
| 151 | 166 |
| 152 @config_ctx() | 167 |
| 153 def chromiumos_coverage_test(c): | 168 @config_ctx(includes=['master_chromiumos']) |
| 169 def chromiumos_coverage(c): |
| 154 c.use_chrome_version = True | 170 c.use_chrome_version = True |
| 155 c.read_cros_manifest = True | 171 c.read_cros_manifest = True |
| 156 c.cbb.chrome_rev = 'stable' | 172 c.cbb.chrome_rev = 'stable' |
| 173 c.cbb.config_repo = 'https://example.com/repo.git' |
| 174 |
| 175 # TODO(dnj): Remove this config once variant support is removed. |
| 176 @config_ctx() |
| 177 def coverage_variant(c): |
| 178 c.cbb.chrome_rev = 'canary' |
| OLD | NEW |