OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 'bot_update', | 6 'bot_update', |
| 7 'chromium', |
7 'gclient', | 8 'gclient', |
8 'gsutil', | 9 'gsutil', |
9 'omahaproxy', | 10 'omahaproxy', |
10 'path', | 11 'path', |
11 'platform', | 12 'platform', |
12 'properties', | 13 'properties', |
13 'python', | 14 'python', |
14 'raw_io', | 15 'raw_io', |
15 'trigger', | 16 'trigger', |
16 ] | 17 ] |
17 | 18 |
18 | 19 |
19 def export_tarball_has_progress(api): | |
20 step_result = api.python( | |
21 'export_tarball.py --help', | |
22 api.path['checkout'].join( | |
23 'tools', 'export_tarball', 'export_tarball.py'), | |
24 ['--help'], | |
25 stdout=api.raw_io.output() | |
26 ) | |
27 return '--progress' in step_result.stdout | |
28 | |
29 | |
30 def export_tarball(api, args, source, destination): | 20 def export_tarball(api, args, source, destination): |
31 try: | 21 try: |
32 temp_dir = api.path.mkdtemp('export_tarball') | 22 temp_dir = api.path.mkdtemp('export_tarball') |
33 api.python( | 23 api.python( |
34 'export_tarball', | 24 'export_tarball', |
35 api.path['checkout'].join( | 25 api.chromium.resource('export_tarball.py'), |
36 'tools', 'export_tarball', 'export_tarball.py'), | |
37 args, | 26 args, |
38 cwd=temp_dir) | 27 cwd=temp_dir) |
39 api.gsutil.upload( | 28 api.gsutil.upload( |
40 api.path.join(temp_dir, source), | 29 api.path.join(temp_dir, source), |
41 'chromium-browser-official', | 30 'chromium-browser-official', |
42 destination) | 31 destination) |
43 finally: | 32 finally: |
44 api.path.rmtree('temp dir', temp_dir) | 33 api.path.rmtree('temp dir', temp_dir) |
45 | 34 |
46 | 35 |
(...skipping 14 matching lines...) Expand all Loading... |
61 api.trigger({'buildername': 'publish_tarball', 'version': version}) | 50 api.trigger({'buildername': 'publish_tarball', 'version': version}) |
62 return | 51 return |
63 | 52 |
64 version = api.properties['version'] | 53 version = api.properties['version'] |
65 | 54 |
66 api.gclient.set_config('chromium') | 55 api.gclient.set_config('chromium') |
67 solution = api.gclient.c.solutions[0] | 56 solution = api.gclient.c.solutions[0] |
68 solution.revision = 'refs/tags/%s' % version | 57 solution.revision = 'refs/tags/%s' % version |
69 api.bot_update.ensure_checkout(force=True, with_branch_heads=True) | 58 api.bot_update.ensure_checkout(force=True, with_branch_heads=True) |
70 | 59 |
71 extra_args = [] | |
72 if export_tarball_has_progress(api): | |
73 extra_args.append('--progress') | |
74 export_tarball( | 60 export_tarball( |
75 api, | 61 api, |
76 # Verbose output helps avoid a buildbot timeout when no output | 62 # Verbose output helps avoid a buildbot timeout when no output |
77 # is produced for a long time. | 63 # is produced for a long time. |
78 ['--remove-nonessential-files', | 64 ['--remove-nonessential-files', |
79 'chromium-%s' % version, | 65 'chromium-%s' % version, |
80 '--verbose'] + extra_args, | 66 '--verbose', |
| 67 '--progress'], |
81 'chromium-%s.tar.xz' % version, | 68 'chromium-%s.tar.xz' % version, |
82 'chromium-%s.tar.xz' % version) | 69 'chromium-%s.tar.xz' % version) |
83 | 70 |
84 def GenTests(api): | 71 def GenTests(api): |
85 yield ( | 72 yield ( |
86 api.test('basic') + | 73 api.test('basic') + |
87 api.properties.generic(version='38.0.2125.122') + | 74 api.properties.generic(version='38.0.2125.122') + |
88 api.platform('linux', 64) + | 75 api.platform('linux', 64) |
89 api.step_data('export_tarball.py --help', | |
90 stdout=api.raw_io.output('--progress')) | |
91 ) | 76 ) |
92 | 77 |
93 yield ( | 78 yield ( |
94 api.test('trigger') + | 79 api.test('trigger') + |
95 api.properties.generic() + | 80 api.properties.generic() + |
96 api.platform('linux', 64) + | 81 api.platform('linux', 64) + |
97 api.step_data('gsutil ls', stdout=api.raw_io.output('')) | 82 api.step_data('gsutil ls', stdout=api.raw_io.output('')) |
98 ) | 83 ) |
OLD | NEW |