1 #! /usr/bin/env python3
7 from path
import convert_to_unix
9 from tools
import replace_variables_in_string
13 # product_name = sys.argv[1]
15 platform
= sys
.argv
[3]
16 update_dir
= sys
.argv
[4]
17 upload_url_arg
= sys
.argv
[5]
20 upload_url
= replace_variables_in_string(upload_url_arg
, channel
=channel
, buildid
=buildid
,
23 target_url
, target_dir
= upload_url
.split(':')
25 command
= "ssh %s 'mkdir -p %s'" % (target_url
, target_dir
)
27 subprocess
.call(command
, shell
=True)
28 for file in os
.listdir(update_dir
):
29 if file.endswith('.mar'):
30 subprocess
.call(['scp', convert_to_unix(os
.path
.join(update_dir
, file)), upload_url
])
33 if __name__
== '__main__':