Archive failures to cloud storage if gradle fails and the archive flag
is set
This will upload the build/reports/tests directory to cloud storage
making it readable directly from the printed link
R=sgjesse@google.com
Bug:
Change-Id: I300ad4949de5a25395989dd2f3c54635b197a9bb
diff --git a/tools/utils.py b/tools/utils.py
index 8c4f710..fd7212b 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -50,6 +50,13 @@
if not os.path.isdir(path):
raise
+def upload_html_to_cloud_storage(directory, destination):
+ # Upload and make the content encoding right for viewing directly
+ cmd = ['gsutil.py', 'cp', '-z', 'html', '-a',
+ 'public-read', '-R', directory, destination]
+ PrintCmd(cmd)
+ subprocess.check_call(cmd)
+
class TempDir(object):
def __init__(self, prefix=''):
self._temp_dir = None