OLD | NEW |
| (Empty) |
1 #!/usr/bin/env python | |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
6 """ Run this before running any tests. """ | |
7 | |
8 from build_step import BuildStep | |
9 from py.utils import shell_utils | |
10 from utils import gs_utils | |
11 from utils import upload_to_bucket | |
12 import os | |
13 import posixpath | |
14 import skia_vars | |
15 import sys | |
16 | |
17 | |
18 GS_DRT_SUBDIR = 'chrome_drt_results' | |
19 | |
20 | |
21 class ChromeDRTCanaryUploadResults(BuildStep): | |
22 def _Run(self): | |
23 # Tar up the results. | |
24 result_tarball = '%s_%s.tgz' % (self._builder_name, | |
25 self._got_revision) | |
26 shell_utils.run(['tar', '-cvzf', os.path.join(os.pardir, result_tarball), | |
27 self._flavor_utils.result_dir]) | |
28 | |
29 # Upload to Google Storage | |
30 bucket_url = gs_utils.GSUtils.with_gs_prefix( | |
31 skia_vars.GetGlobalVariable('googlestorage_bucket')) | |
32 upload_to_bucket.upload_to_bucket( | |
33 os.path.join(os.pardir, result_tarball), | |
34 bucket_url, | |
35 subdir=GS_DRT_SUBDIR) | |
36 | |
37 print 'To download the tarball, run this command:' | |
38 gs_url = posixpath.join( | |
39 bucket_url, | |
40 GS_DRT_SUBDIR, | |
41 result_tarball) | |
42 print 'gsutil cp %s <local_dir>' % gs_url | |
43 | |
44 | |
45 if '__main__' == __name__: | |
46 sys.exit(BuildStep.RunBuildStep(ChromeDRTCanaryUploadResults)) | |
OLD | NEW |