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
13 product_name
= sys
.argv
[1]
15 platform
= sys
.argv
[3]
16 update_dir
= sys
.argv
[4]
17 update_config
= sys
.argv
[5]
19 config
= parse_config(update_config
)
20 upload_url
= replace_variables_in_string(config
.upload_url
, channel
=config
.channel
, buildid
=buildid
, platform
=platform
)
22 target_url
, target_dir
= upload_url
.split(':')
24 command
= "ssh %s 'mkdir -p %s'"%(target_url
, target_dir
)
26 subprocess
.call(command
, shell
=True)
27 for file in os
.listdir(update_dir
):
28 if file.endswith('.mar'):
29 subprocess
.call(['scp', convert_to_unix(os
.path
.join(update_dir
, file)), upload_url
])
31 if __name__
== '__main__':