mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Complete nightly scripts update to new b2 cli version
This commit is contained in:
@@ -13,7 +13,7 @@ def main():
|
|||||||
for x in files_lines:
|
for x in files_lines:
|
||||||
parts = x.split(" ", 1)
|
parts = x.split(" ", 1)
|
||||||
if parts[0]:
|
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)
|
data = json.loads(json_str)
|
||||||
name = remove_prefix(data['fileName'], "nightly/")
|
name = remove_prefix(data['fileName'], "nightly/")
|
||||||
url = f"https://f001.backblazeb2.com/file/{bucket}/nightly/{urllib.parse.quote_plus(name)}"
|
url = f"https://f001.backblazeb2.com/file/{bucket}/nightly/{urllib.parse.quote_plus(name)}"
|
||||||
@@ -48,4 +48,3 @@ def execute_cli(command):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ def main():
|
|||||||
print(f"Looking for binaries to delete older than {days_to_keep} days")
|
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")
|
files_lines = execute_cli(f"b2 ls --long --versions b2://{bucket}/nightly/").split("\n")
|
||||||
print(files_lines)
|
|
||||||
for x in files_lines:
|
for x in files_lines:
|
||||||
parts = [y for y in x.split(' ') if y]
|
parts = [y for y in x.split(' ') if y]
|
||||||
|
|
||||||
@@ -23,7 +22,7 @@ def main():
|
|||||||
|
|
||||||
if delta.days > days_to_keep:
|
if delta.days > days_to_keep:
|
||||||
print(f'Deleting {parts[5]}')
|
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):
|
def execute_cli(command):
|
||||||
@@ -32,4 +31,3 @@ def execute_cli(command):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
||||||
|
|||||||
@@ -22,4 +22,4 @@ else
|
|||||||
7z a -bd "output/$filename" -r "$artifact"
|
7z a -bd "output/$filename" -r "$artifact"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
b2 upload-file "$bucket" "output/$filename" "nightly/$filename"
|
b2 file upload "$bucket" "output/$filename" "nightly/$filename"
|
||||||
|
|||||||
Reference in New Issue
Block a user