mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-08-06 00:35:44 +08:00
jenkins: publish casync releases from device (#32142)
* publish in ci * overwrite * publish in ci * fix * test it * Revert "test it" This reverts commit b3de51dc693df79b980d7dffc18bcc3c88d83375. * use right token * cleanup after uploading --------- Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -57,18 +57,18 @@ class AzureContainer:
|
||||
ext = "hevc" if log_type.endswith('camera') else "bz2"
|
||||
return self.BASE_URL + f"{route_name.replace('|', '/')}/{segment_num}/{log_type}.{ext}"
|
||||
|
||||
def upload_bytes(self, data: bytes | IO, blob_name: str) -> str:
|
||||
def upload_bytes(self, data: bytes | IO, blob_name: str, overwrite=False) -> str:
|
||||
from azure.storage.blob import BlobClient
|
||||
blob = BlobClient(
|
||||
account_url=self.ACCOUNT_URL,
|
||||
container_name=self.CONTAINER,
|
||||
blob_name=blob_name,
|
||||
credential=get_azure_credential(),
|
||||
overwrite=False,
|
||||
overwrite=overwrite,
|
||||
)
|
||||
blob.upload_blob(data)
|
||||
blob.upload_blob(data, overwrite=overwrite)
|
||||
return self.BASE_URL + blob_name
|
||||
|
||||
def upload_file(self, path: str | os.PathLike, blob_name: str) -> str:
|
||||
def upload_file(self, path: str | os.PathLike, blob_name: str, overwrite=False) -> str:
|
||||
with open(path, "rb") as f:
|
||||
return self.upload_bytes(f, blob_name)
|
||||
return self.upload_bytes(f, blob_name, overwrite)
|
||||
|
||||
Reference in New Issue
Block a user