Chromium Code Reviews

Side by Side Diff: scripts/slave/recipe_modules/cipd/example.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.
Jump to:
View unified diff |
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 DEPS = [ 5 DEPS = [
6 'depot_tools/infra_paths',
7 'file', 6 'file',
8 'recipe_engine/path', 7 'recipe_engine/path',
9 'recipe_engine/platform', 8 'recipe_engine/platform',
10 'recipe_engine/properties', 9 'recipe_engine/properties',
11 'recipe_engine/step', 10 'recipe_engine/step',
12 'cipd', 11 'cipd',
13 ] 12 ]
14 13
15 def RunSteps(api): 14 def RunSteps(api):
16 # First, you need a cipd client. 15 # First, you need a cipd client.
17 api.cipd.install_client('install cipd') 16 api.cipd.install_client('install cipd')
18 api.cipd.install_client('install cipd', version='deadbeaf') 17 api.cipd.install_client('install cipd', version='deadbeaf')
19 assert api.cipd.get_executable() 18 assert api.cipd.get_executable()
20 19
21 package_name = 'public/package/%s' % api.cipd.platform_suffix() 20 package_name = 'public/package/%s' % api.cipd.platform_suffix()
22 package_instance_id = '7f751b2237df2fdf3c1405be00590fefffbaea2d' 21 package_instance_id = '7f751b2237df2fdf3c1405be00590fefffbaea2d'
23 packages = {package_name: package_instance_id} 22 packages = {package_name: package_instance_id}
24 23
25 cipd_root = api.infra_paths['slave_build'].join('packages') 24 cipd_root = api.path['slave_build'].join('packages')
26 # Some packages don't require credentials to be installed or queried. 25 # Some packages don't require credentials to be installed or queried.
27 api.cipd.ensure(cipd_root, packages) 26 api.cipd.ensure(cipd_root, packages)
28 step = api.cipd.search(package_name, tag='git_revision:40-chars-long-hash') 27 step = api.cipd.search(package_name, tag='git_revision:40-chars-long-hash')
29 api.cipd.describe(package_name, 28 api.cipd.describe(package_name,
30 version=step.json.output['result'][0]['instance_id']) 29 version=step.json.output['result'][0]['instance_id'])
31 30
32 # Others do, so provide creds first. 31 # Others do, so provide creds first.
33 api.cipd.set_service_account_credentials('fake-credentials.json') 32 api.cipd.set_service_account_credentials('fake-credentials.json')
34 private_package_name = 'private/package/%s' % api.cipd.platform_suffix() 33 private_package_name = 'private/package/%s' % api.cipd.platform_suffix()
35 packages[private_package_name] = 'latest' 34 packages[private_package_name] = 'latest'
(...skipping 57 matching lines...)
93 api.test('describe-many-instances') + 92 api.test('describe-many-instances') +
94 api.platform('linux', 64) + 93 api.platform('linux', 64) +
95 api.override_step_data( 94 api.override_step_data(
96 'cipd search fake-package/linux-amd64 dead:beaf', 95 'cipd search fake-package/linux-amd64 dead:beaf',
97 api.cipd.example_search( 96 api.cipd.example_search(
98 'public/package/linux-amd64-ubuntu14_04', 97 'public/package/linux-amd64-ubuntu14_04',
99 instances=3 98 instances=3
100 ) 99 )
101 ) 100 )
102 ) 101 )
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/cipd/api.py ('k') | scripts/slave/recipe_modules/cipd/example.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine