From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:54:39 +0200 Subject: Adding upstream version 4:24.2.0. Signed-off-by: Daniel Baumann --- bin/update/upload_builds.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 bin/update/upload_builds.py (limited to 'bin/update/upload_builds.py') diff --git a/bin/update/upload_builds.py b/bin/update/upload_builds.py new file mode 100755 index 0000000000..97a2f28484 --- /dev/null +++ b/bin/update/upload_builds.py @@ -0,0 +1,34 @@ +#! /usr/bin/env python3 + +import sys +import os +import subprocess + +from path import convert_to_unix + +from tools import replace_variables_in_string + + +def main(): + # product_name = sys.argv[1] + buildid = sys.argv[2] + platform = sys.argv[3] + update_dir = sys.argv[4] + upload_url_arg = sys.argv[5] + channel = sys.argv[6] + + upload_url = replace_variables_in_string(upload_url_arg, channel=channel, buildid=buildid, + platform=platform) + + target_url, target_dir = upload_url.split(':') + + command = "ssh %s 'mkdir -p %s'" % (target_url, target_dir) + print(command) + subprocess.call(command, shell=True) + for file in os.listdir(update_dir): + if file.endswith('.mar'): + subprocess.call(['scp', convert_to_unix(os.path.join(update_dir, file)), upload_url]) + + +if __name__ == '__main__': + main() -- cgit v1.2.3