OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2014 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 """Uploads the results of render_skps.py. | 6 """Uploads the results of render_skps.py.""" |
7 | 7 |
8 TODO(epoger): In the midst of re-implementing using checksums; | 8 import os |
9 see https://code.google.com/p/skia/issues/detail?id=1942 | 9 import posixpath |
10 """ | |
11 | |
12 import sys | 10 import sys |
13 | 11 |
14 from build_step import BuildStep | 12 from build_step import BuildStep, PLAYBACK_CANNED_ACL |
13 from utils import gs_utils | |
14 import skia_vars | |
15 import upload_gm_results | 15 import upload_gm_results |
16 | 16 |
17 SUBDIR_NAME = 'rendered-skps' | |
18 | |
17 | 19 |
18 class UploadRenderedSKPs(upload_gm_results.UploadGMResults): | 20 class UploadRenderedSKPs(upload_gm_results.UploadGMResults): |
19 | 21 |
20 def __init__(self, attempts=3, **kwargs): | 22 def __init__(self, attempts=3, **kwargs): |
21 super(UploadRenderedSKPs, self).__init__( | 23 super(UploadRenderedSKPs, self).__init__( |
22 attempts=attempts, **kwargs) | 24 attempts=attempts, **kwargs) |
23 | 25 |
24 def _Run(self): | 26 def _Run(self): |
25 self._SVNUploadJsonFiles(src_dir=self.skp_out_dir, | 27 # Upload individual image files to Google Storage. |
26 dest_subdir='rendered-skps') | 28 src_dir = os.path.abspath(self.playback_actual_images_dir) |
29 if os.listdir(src_dir): | |
epoger
2014/05/21 18:21:16
Local testing verifies that patchset 3 fixes the U
epoger
2014/05/21 18:22:56
example of a production error this would have prev
| |
30 dest_dir=posixpath.join( | |
31 skia_vars.GetGlobalVariable('googlestorage_bucket'), SUBDIR_NAME) | |
32 print 'Uploading image files from %s to %s.' % ( | |
33 src_dir, dest_dir) | |
34 gs_utils.copy_storage_directory(src_dir=src_dir, dest_dir=dest_dir, | |
35 gs_acl=PLAYBACK_CANNED_ACL) | |
36 else: | |
37 print ('No image files in %s, so skipping upload to Google Storage.' % | |
38 src_dir) | |
27 | 39 |
40 # Upload image summaries (checksums) to skia-autogen. | |
41 # | |
42 # TODO(epoger): Change ACLs of files uploaded to Google Storage to | |
43 # google.com:READ . See _SetGoogleReadACLs() in | |
44 # https://skia.googlesource.com/buildbot/+/master/slave/skia_slave_scripts/w ebpages_playback.py | |
45 self._SVNUploadJsonFiles(src_dir=self.playback_actual_summaries_dir, | |
46 dest_subdir=SUBDIR_NAME) | |
28 | 47 |
29 if '__main__' == __name__: | 48 if '__main__' == __name__: |
30 sys.exit(BuildStep.RunBuildStep(UploadRenderedSKPs)) | 49 sys.exit(BuildStep.RunBuildStep(UploadRenderedSKPs)) |
OLD | NEW |