Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / bin / update / upload_builds.py
blob1be1b2fe837e709d819da2939ee9237c468d1e3a
1 #! /usr/bin/env python3
3 import sys
4 import os
5 import subprocess
7 from config import parse_config
8 from path import convert_to_unix
10 from tools import replace_variables_in_string
13 def main():
14 # product_name = sys.argv[1]
15 buildid = sys.argv[2]
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,
22 platform=platform)
24 target_url, target_dir = upload_url.split(':')
26 command = "ssh %s 'mkdir -p %s'" % (target_url, target_dir)
27 print(command)
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__':
35 main()