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