6from recipe_engine
import recipe_api
13 """Attempt to upload files to Gold.
14 This module assumes setup has occurred for the vars
and flavor modules.
16 revision = self.m.properties['revision']
17 results_dir = self.m.flavor.host_dirs.dm_dir
21 image_dest_path =
'gs://%s/dm-images-v1' % self.m.properties[
'gs_bucket']
23 files_to_upload = self.m.file.glob_paths(
24 'find %s images' % ext,
27 test_data=[
'someimage.png'])
29 files_to_upload = [f
for f
in files_to_upload
if str(f).endswith(ext)]
30 if len(files_to_upload) > 0:
31 extra_gsutil_args =
None
32 if self.m.platform.is_mac:
33 extra_gsutil_args = [
'-o',
'GSUtil:parallel_process_count=1']
34 self.m.gsutil.cp(
'%s images' % ext, results_dir.join(
'*%s' % ext),
35 image_dest_path, extra_gsutil_args=extra_gsutil_args,
38 summary_dest_path =
'gs://%s' % self.m.properties[
'gs_bucket']
41 if self.m.vars.is_trybot:
42 summary_dest_path =
'/'.
join([summary_dest_path,
'trybot'])
43 ref =
'%s_%s' % (str(self.m.vars.issue), str(self.m.vars.patchset))
46 now = self.m.time.utcnow()
47 summary_dest_path =
'/'.
join([
50 str(now.year ).zfill(4),
51 str(now.month).zfill(2),
52 str(now.day ).zfill(2),
53 str(now.hour ).zfill(2),
55 self.m.vars.builder_name,
56 str(
int(calendar.timegm(now.utctimetuple())))])
59 json_file = results_dir.join(DM_JSON)
61 self.m.gsutil.cp(
'dm.json', json_file,
62 summary_dest_path +
'/' + DM_JSON, extra_args=[
'-Z'])
static SkString join(const CommandLineFlags::StringArray &)