Skip to content

Commit a0ff33f

Browse files
committed
add upload to justfile
1 parent 08a5e83 commit a0ff33f

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,6 @@ download-design-tokens:
139139
# Update the results of `insta` snapshot regression tests
140140
update-insta-tests:
141141
cargo test; cargo insta review
142+
143+
upload *ARGS:
144+
python3 "scripts/upload_image.py" {{ARGS}}

scripts/upload_image.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import argparse
1212
import hashlib
13-
import logging
1413
import os
1514
import subprocess
1615

@@ -26,19 +25,14 @@ def content_hash(path: str) -> str:
2625

2726

2827
def main() -> None:
29-
logging.getLogger().addHandler(logging.StreamHandler())
30-
logging.getLogger().setLevel("INFO")
31-
3228
parser = argparse.ArgumentParser(description="Upload an image.")
3329
parser.add_argument("file", type=str, help="Path to the image.")
34-
35-
args, unknown = parser.parse_known_args()
36-
for arg in unknown:
37-
logging.warning(f"unknown arg: {arg}")
30+
args = parser.parse_args()
3831

3932
object_name = content_hash(args.file) + f"_{os.path.basename(args.file)}"
4033

4134
subprocess.check_output(["gsutil", "cp", args.file, f"gs://rerun-static-img/{object_name}"])
35+
print(f"https://static.rerun.io/{object_name}")
4236

4337

4438
if __name__ == "__main__":

0 commit comments

Comments
 (0)