gcs.py 333 B

1234567891011121314
  1. #!/usr/bin/python3
  2. import tempfile
  3. from google.cloud import storage
  4. from dulwich.cloud.gcs import GcsObjectStore
  5. from dulwich.repo import Repo
  6. client = storage.Client()
  7. bucket = client.get_bucket('mybucket')
  8. gcs_object_store = GcsObjectStore(bucket, 'path')
  9. r = Repo.init_bare(tempfile.mkdtemp(), object_store=gcs_object_store)