1 #! /usr/bin/env python3
7 from config
import parse_config
8 from path
import convert_to_unix
10 from tools
import replace_variables_in_string
14 # product_name = sys.argv[1]
16 platform
= sys
.argv
[3]
17 update_dir
= sys
.argv
[4]
18 update_config
= sys
.argv
[5]
20 config
= parse_config(update_config
)
21 upload_url
= replace_variables_in_string(config
.upload_url
, channel
=config
.channel
, buildid
=buildid
,
24 target_url
, target_dir
= upload_url
.split(':')
26 command
= "ssh %s 'mkdir -p %s'" % (target_url
, target_dir
)
28 subprocess
.call(command
, shell
=True)
29 for file in os
.listdir(update_dir
):
30 if file.endswith('.mar'):
31 subprocess
.call(['scp', convert_to_unix(os
.path
.join(update_dir
, file)), upload_url
])
34 if __name__
== '__main__':