From 303d86ab7e54abb084bb96a556b6ff6d4a2d0f63 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Tue, 4 Jun 2024 11:26:57 +0200 Subject: Complete nightly scripts update to new b2 cli version --- ci/create_nightly_json.py | 5 ++--- ci/delete_old_binaries.py | 6 ++---- ci/upload_create_nightly.sh | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'ci') diff --git a/ci/create_nightly_json.py b/ci/create_nightly_json.py index d7029399a..03c653040 100644 --- a/ci/create_nightly_json.py +++ b/ci/create_nightly_json.py @@ -13,7 +13,7 @@ def main(): for x in files_lines: parts = x.split(" ", 1) if parts[0]: - json_str = execute_cli(f"b2 get-file-info {parts[0]}") + json_str = execute_cli(f"b2 file info {parts[0]}") data = json.loads(json_str) name = remove_prefix(data['fileName'], "nightly/") url = f"https://f001.backblazeb2.com/file/{bucket}/nightly/{urllib.parse.quote_plus(name)}" @@ -47,5 +47,4 @@ def execute_cli(command): return sb.stdout.read().decode("utf-8"); if __name__ == '__main__': - sys.exit(main()) - + sys.exit(main()) \ No newline at end of file diff --git a/ci/delete_old_binaries.py b/ci/delete_old_binaries.py index 39e8ff2ac..6ea3cb78d 100644 --- a/ci/delete_old_binaries.py +++ b/ci/delete_old_binaries.py @@ -12,7 +12,6 @@ def main(): print(f"Looking for binaries to delete older than {days_to_keep} days") files_lines = execute_cli(f"b2 ls --long --versions b2://{bucket}/nightly/").split("\n") - print(files_lines) for x in files_lines: parts = [y for y in x.split(' ') if y] @@ -23,7 +22,7 @@ def main(): if delta.days > days_to_keep: print(f'Deleting {parts[5]}') - execute_cli(f'b2 delete-file-version {parts[0]}') + execute_cli(f'b2 rm {parts[0]}') def execute_cli(command): @@ -31,5 +30,4 @@ def execute_cli(command): return sb.stdout.read().decode("utf-8"); if __name__ == '__main__': - sys.exit(main()) - + sys.exit(main()) \ No newline at end of file diff --git a/ci/upload_create_nightly.sh b/ci/upload_create_nightly.sh index a4122f1da..8404b33ff 100755 --- a/ci/upload_create_nightly.sh +++ b/ci/upload_create_nightly.sh @@ -22,4 +22,4 @@ else 7z a -bd "output/$filename" -r "$artifact" fi -b2 upload-file "$bucket" "output/$filename" "nightly/$filename" +b2 file upload "$bucket" "output/$filename" "nightly/$filename" -- cgit v1.2.3