Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 from recipe_engine import recipe_api | |
| 6 | |
| 7 class CIPDApi(recipe_api.RecipeApi): | |
| 8 """CIPDApi provides support for CIPD.""" | |
| 9 CLIENT_VERSIONS = { | |
| 10 'linux-amd64': '9579504cec0336688292f5b0b68c3ed4e288e273', | |
| 11 } | |
| 12 | |
| 13 def install_client(self, step_name): | |
| 14 self.bin_path = self.m.path['slave_build'].join('cipd/cipd_%s' % self.CLIENT _VERSIONS[self.platform_tag()]) | |
|
Vadim Sh.
2015/06/30 23:14:29
80 cols limit, split in two lines
seanmccullough
2015/06/30 23:48:25
Done.
| |
| 15 package = "infra/tools/cipd/%s" % self.platform_tag() | |
| 16 script_input = { | |
| 17 'package': package, | |
| 18 'version': self.CLIENT_VERSIONS[self.platform_tag()], | |
|
Vadim Sh.
2015/06/30 23:14:29
'bin_path': self.bin_path
and make bootstrap.py i
seanmccullough
2015/06/30 23:48:25
Done.
| |
| 19 } | |
| 20 | |
| 21 self.m.python( | |
| 22 name=step_name, | |
| 23 script=self.resource('bootstrap.py'), | |
| 24 stdin=self.m.json.input(script_input)) | |
| 25 | |
| 26 # TODO(seanmccullough): clean up older CIPD installations. | |
| 27 | |
| 28 def platform_tag(self): | |
| 29 # TODO(seanmccullough): get the arch from env instead of hardcoding it. | |
| 30 return "linux-amd64" | |
| 31 | |
| 32 def ensure_installed(self, root, pkgs): | |
| 33 pkg_list = [] | |
| 34 for pkg_name in pkgs: | |
|
Vadim Sh.
2015/06/30 23:14:29
sorted(pkgs)
seanmccullough
2015/06/30 23:48:25
Done.
| |
| 35 pkg_spec = pkgs[pkg_name] | |
| 36 pkg_list.append("%s %s" % (pkg_name, pkg_spec['version'])) | |
| 37 | |
| 38 list_data = self.m.raw_io.input("\n".join(pkg_list)) | |
| 39 | |
| 40 self.m.step( | |
| 41 "ensure_installed", | |
| 42 [self.m.path['slave_build'].join('cipd'), "ensure", | |
|
Vadim Sh.
2015/06/30 23:14:29
Use self.bin_path. Check that it's not None. If it
seanmccullough
2015/06/30 23:48:25
Added this, but raising StepFailure in this condit
Vadim Sh.
2015/07/01 00:10:56
Dunno.. Based on this log, no steps were called at
| |
| 43 "--root", root, "--list", list_data], | |
| 44 ) | |
| 45 | |
| OLD | NEW |