OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """cipd.py bootstraps a CIPD client and installs named CIPD packages to a | 6 """cipd.py bootstraps a CIPD client and installs named CIPD packages to a |
7 directory. | 7 directory. |
8 """ | 8 """ |
9 | 9 |
10 import argparse | 10 import argparse |
(...skipping 17 matching lines...) Expand all Loading... |
28 LOGGER = logging.getLogger('cipd') | 28 LOGGER = logging.getLogger('cipd') |
29 | 29 |
30 # Used to contain a CIPD package specification. | 30 # Used to contain a CIPD package specification. |
31 CipdPackage = collections.namedtuple('CipdPackage', ('name', 'version')) | 31 CipdPackage = collections.namedtuple('CipdPackage', ('name', 'version')) |
32 | 32 |
33 # A CIPD binary description - relative path of the binary within the package. | 33 # A CIPD binary description - relative path of the binary within the package. |
34 CipdBinary = collections.namedtuple('CipdBinary', ('package', 'relpath')) | 34 CipdBinary = collections.namedtuple('CipdBinary', ('package', 'relpath')) |
35 | 35 |
36 | 36 |
37 def bootstrap(path): | 37 def bootstrap(path): |
38 bootstrap_path = os.path.join(common.env.Build, 'scripts', 'slave', | 38 bootstrap_path = os.path.join( |
39 'recipe_modules', 'cipd', 'resources', | 39 common.env.Build, 'scripts', 'slave', 'cipd_bootstrap.py') |
40 'bootstrap.py') | |
41 | 40 |
42 plat, bits = slave.infra_platform.get() | 41 plat, bits = slave.infra_platform.get() |
43 plat = '%s-%s' % ( | 42 plat = '%s-%s' % ( |
44 plat.replace('win', 'windows'), | 43 plat.replace('win', 'windows'), |
45 { | 44 { |
46 32: '386', | 45 32: '386', |
47 64: 'amd64', | 46 64: 'amd64', |
48 }[bits] | 47 }[bits] |
49 ) | 48 ) |
50 json_output = os.path.join(path, 'cipd_bootstrap.json') | 49 json_output = os.path.join(path, 'cipd_bootstrap.json') |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 LOGGER.info('CIPD ensuring %d package(s)...', len(opts.package)) | 133 LOGGER.info('CIPD ensuring %d package(s)...', len(opts.package)) |
135 cipd_ensure(client, opts.dest_directory, opts.package, | 134 cipd_ensure(client, opts.dest_directory, opts.package, |
136 service_account_json=opts.service_account_json, | 135 service_account_json=opts.service_account_json, |
137 json_output=opts.json_output) | 136 json_output=opts.json_output) |
138 return 0 | 137 return 0 |
139 | 138 |
140 | 139 |
141 if __name__ == '__main__': | 140 if __name__ == '__main__': |
142 logging.basicConfig(level=logging.WARNING) | 141 logging.basicConfig(level=logging.WARNING) |
143 sys.exit(main(sys.argv)) | 142 sys.exit(main(sys.argv)) |
OLD | NEW |