diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-09-06 04:48:44 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-05-19 03:43:22 +0200 |
commit | 7f52e3848e8b153f8a0b6bb7eef4f40afabe7e69 (patch) | |
tree | a19fad240fe462bb0b4f1ab05cf5c15ecdcf5793 /bin/update/upload_builds.py | |
parent | 94fd45a29d8302886e132aaf4f8b75b6903e8536 (diff) |
move most of the updater settings to ini file
Also finally add the initial version of the upload scripts.
Change-Id: I3ad5bcbeba60f0cf9700e5fe5001a24f162a3244
Diffstat (limited to 'bin/update/upload_builds.py')
-rwxr-xr-x | bin/update/upload_builds.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/bin/update/upload_builds.py b/bin/update/upload_builds.py new file mode 100755 index 000000000000..20d683d02ace --- /dev/null +++ b/bin/update/upload_builds.py @@ -0,0 +1,29 @@ +#! /usr/bin/env python3 + +import sys +import os +import subprocess + +from config import parse_config + +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] + update_config = sys.argv[5] + + config = parse_config(update_config) + upload_url = replace_variables_in_string(config.upload_url, channel=config.channel, buildid=buildid, platform=platform) + + target_url, target_dir = upload_url.split(':') + + subprocess.call(['ssh', target_url, "'mkdir -p %s'"%(target_dir)]) + for file in os.listdir(update_dir): + if file.endswith('.mar'): + subprocess.call(['scp', os.path.join(update_dir, file), upload_url]) + +if __name__ == '__main__': + main() |