Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: scripts/slave/recipe_modules/goma/api.py

Issue 1917243002: Revert "build: roll infra_paths changes" (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 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 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 from recipe_engine import recipe_api 5 from recipe_engine import recipe_api
6 6
7 class GomaApi(recipe_api.RecipeApi): 7 class GomaApi(recipe_api.RecipeApi):
8 """GomaApi contains helper functions for using goma.""" 8 """GomaApi contains helper functions for using goma."""
9 9
10 @property 10 @property
11 def service_account_json_path(self): 11 def service_account_json_path(self):
12 if self.m.platform.is_win: 12 if self.m.platform.is_win:
13 return 'C:\\creds\\service_accounts\\service-account-goma-client.json' 13 return 'C:\\creds\\service_accounts\\service-account-goma-client.json'
14 return '/creds/service_accounts/service-account-goma-client.json' 14 return '/creds/service_accounts/service-account-goma-client.json'
15 15
16 def update_goma_canary(self): 16 def update_goma_canary(self):
17 """Returns a step for updating goma canary.""" 17 """Returns a step for updating goma canary."""
18 # deprecated? switch to use ensure_goma with canary=True. 18 # deprecated? switch to use ensure_goma with canary=True.
19 # for git checkout, should use @refs/heads/master to use head. 19 # for git checkout, should use @refs/heads/master to use head.
20 head = 'refs/heads/master' 20 head = 'refs/heads/master'
21 # TODO(phajdan.jr): Remove infra_paths['build'] usage, http://crbug.com/4372 64 . 21 # TODO(phajdan.jr): Remove path['build'] usage, http://crbug.com/437264 .
22 self.m.gclient('update goma canary', 22 self.m.gclient('update goma canary',
23 ['sync', '--verbose', '--force', 23 ['sync', '--verbose', '--force',
24 '--revision', 'build/goma@%s' % head], 24 '--revision', 'build/goma@%s' % head],
25 cwd=self.m.infra_paths['build']) 25 cwd=self.m.path['build'])
26 26
27 def ensure_goma(self): 27 def ensure_goma(self):
28 with self.m.step.nest('ensure_goma'): 28 with self.m.step.nest('ensure_goma'):
29 try: 29 try:
30 self.m.cipd.set_service_account_credentials( 30 self.m.cipd.set_service_account_credentials(
31 self.service_account_json_path) 31 self.service_account_json_path)
32 32
33 self.m.cipd.install_client() 33 self.m.cipd.install_client()
34 goma_package = ('infra_internal/goma/client/%s' % 34 goma_package = ('infra_internal/goma/client/%s' %
35 self.m.cipd.platform_suffix()) 35 self.m.cipd.platform_suffix())
36 # For Windows there's only 64-bit goma client. 36 # For Windows there's only 64-bit goma client.
37 if self.m.platform.is_win: 37 if self.m.platform.is_win:
38 goma_package = goma_package.replace('386', 'amd64') 38 goma_package = goma_package.replace('386', 'amd64')
39 goma_dir = self.m.infra_paths['cache'].join('cipd', 'goma') 39 goma_dir = self.m.path['cache'].join('cipd', 'goma')
40 self.m.cipd.ensure(goma_dir, {goma_package: 'release'}) 40 self.m.cipd.ensure(goma_dir, {goma_package: 'release'})
41 return goma_dir 41 return goma_dir
42 except self.m.step.StepFailure: # pragma: no cover 42 except self.m.step.StepFailure: # pragma: no cover
43 # TODO(phajdan.jr): make failures fatal after experiment. 43 # TODO(phajdan.jr): make failures fatal after experiment.
44 return None 44 return None
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/goma/__init__.py ('k') | scripts/slave/recipe_modules/gsutil/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698