summaryrefslogtreecommitdiff
path: root/cbuildbot/binhost.py
diff options
context:
space:
mode:
authorBertrand SIMONNET <bsimonnet@chromium.org>2015-03-27 08:42:16 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-03-27 22:21:17 +0000
commite116fff921f4e2625026921f26f4868ca6559c19 (patch)
treec42d57f90c54cac58956428652566af28916c47e /cbuildbot/binhost.py
parentf1d16a69953f85e9a911f7e693463e415d6019c3 (diff)
downloadchromite-e116fff921f4e2625026921f26f4868ca6559c19.tar.gz
Chrome binhost: Publish the binhost map publicly.
When posting the chrome binhost mapping, post a filtered version of it externally. BUG=chromium:443254 TEST=trybot. TEST=manual: cbuildbot/update_binhost_json generates both files. Change-Id: Id5409820a42e03d964ed84c62b1e66b0a4b6a0da Reviewed-on: https://chromium-review.googlesource.com/262769 Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org> Trybot-Ready: Bertrand Simonnet <bsimonnet@chromium.org> Tested-by: Bertrand Simonnet <bsimonnet@chromium.org> Commit-Queue: Bertrand Simonnet <bsimonnet@chromium.org>
Diffstat (limited to 'cbuildbot/binhost.py')
-rw-r--r--cbuildbot/binhost.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/cbuildbot/binhost.py b/cbuildbot/binhost.py
index 5ae81b4ae..a4965be36 100644
--- a/cbuildbot/binhost.py
+++ b/cbuildbot/binhost.py
@@ -91,18 +91,28 @@ class PrebuiltMapping(_PrebuiltMapping):
"""
# The location in a ChromeOS checkout where we should store our JSON dump.
- MAP_LOCATION = ('%s/src/private-overlays/chromeos-partner-overlay/chromeos/'
- 'binhost/%s.json')
+ INTERNAL_MAP_LOCATION = ('%s/src/private-overlays/chromeos-partner-overlay/'
+ 'chromeos/binhost/%s.json')
+
+ # The location in an external Chromium OS checkout where we should store our
+ # JSON dump.
+ EXTERNAL_MAP_LOCATION = ('%s/src/third_party/chromiumos-overlay/chromeos/'
+ 'binhost/%s.json')
@classmethod
- def GetFilename(cls, buildroot, suffix):
+ def GetFilename(cls, buildroot, suffix, internal=True):
"""Get the filename where we should store our JSON dump.
Args:
buildroot: The root of the source tree.
suffix: The base filename used for the dump (e.g. "chrome").
+ internal: If true, use the internal binhost location. Otherwise, use the
+ public one.
"""
- return cls.MAP_LOCATION % (buildroot, suffix)
+ if internal:
+ return cls.INTERNAL_MAP_LOCATION % (buildroot, suffix)
+
+ return cls.EXTERNAL_MAP_LOCATION % (buildroot, suffix)
@classmethod
def Get(cls, keys, compat_ids):
@@ -125,15 +135,20 @@ class PrebuiltMapping(_PrebuiltMapping):
configs.by_arch_useflags[partial_compat_id].add(key)
return configs
- def Dump(self, filename):
+ def Dump(self, filename, internal=True):
"""Save a mapping of the Chrome PFQ configs to disk (JSON format).
Args:
filename: A location to write the Chrome PFQ configs.
+ internal: Whether the dump should include internal configurations.
"""
output = []
for compat_id, keys in self.by_compat_id.items():
for key in keys:
+ # Filter internal prebuilts out of external dumps.
+ if not internal and 'chrome_internal' in key.useflags:
+ continue
+
output.append({'key': key.__dict__, 'compat_id': compat_id.__dict__})
with open(filename, 'w') as f: