Index: tools/skp/webpages_playback.py |
diff --git a/tools/skp/webpages_playback.py b/tools/skp/webpages_playback.py |
index 1bd216391184efe11e37c908bbbd838d94cc77e9..ee1b8263ab0d80a5f5a7f0073b320ea89c3a0bca 100644 |
--- a/tools/skp/webpages_playback.py |
+++ b/tools/skp/webpages_playback.py |
@@ -71,6 +71,7 @@ from common.py.utils import shell_utils |
ROOT_PLAYBACK_DIR_NAME = 'playback' |
SKPICTURES_DIR_NAME = 'skps' |
+PARTNERS_GS_BUCKET = 'gs://chrome-partner-telemetry' |
# Local archive and SKP directories. |
LOCAL_PLAYBACK_ROOT_DIR = os.path.join( |
@@ -158,6 +159,7 @@ class SkPicturePlayback(object): |
self.gs = GoogleStorageDataStore(data_store_location) |
else: |
self.gs = LocalFileSystemDataStore(data_store_location) |
+ self._upload_to_partner_bucket = parse_options.upload_to_partner_bucket |
self._alternate_upload_dir = parse_options.alternate_upload_dir |
self._telemetry_binaries_dir = os.path.join(parse_options.chrome_src_path, |
'tools', 'perf') |
@@ -368,6 +370,18 @@ class SkPicturePlayback(object): |
print '\n\n=======New SKPs have been uploaded to %s =======\n\n' % ( |
posixpath.join(self.gs.target_name(), dest_dir_name, |
SKPICTURES_DIR_NAME)) |
+ |
+ if self._upload_to_partner_bucket: |
+ print '\n\n=======Uploading to Partner bucket %s =======\n\n' % ( |
+ PARTNERS_GS_BUCKET) |
+ partner_gs = GoogleStorageDataStore(PARTNERS_GS_BUCKET) |
+ partner_gs.upload_dir_contents( |
+ os.path.join(LOCAL_PLAYBACK_ROOT_DIR, SKPICTURES_DIR_NAME), |
+ dest_dir=posixpath.join(SKPICTURES_DIR_NAME, dest_dir_name), |
+ upload_if=gs_utils.GSUtils.UploadIf.IF_MODIFIED) |
+ print '\n\n=======New SKPs have been uploaded to %s =======\n\n' % ( |
+ posixpath.join(partner_gs.target_name(), SKPICTURES_DIR_NAME, |
+ dest_dir_name)) |
else: |
print '\n\n=======Not Uploading to %s=======\n\n' % self.gs.target_type() |
print 'Generated resources are available in %s\n\n' % ( |
@@ -534,6 +548,11 @@ if '__main__' == __name__: |
' if this is True.'), |
default=False) |
option_parser.add_option( |
+ '', '--upload_to_partner_bucket', action='store_true', |
+ help=('Uploads SKPs to the chrome-partner-telemetry Google Storage ' |
+ 'bucket if true.'), |
+ default=False) |
+ option_parser.add_option( |
'', '--data_store', |
help=('The location of the file storage to use to download and upload ' |
'files. Can be \'gs://<bucket>\' for Google Storage, or ' |