gcs.py 333 B

1234567891011121314
  1. #!/usr/bin/python3
  2. from dulwich.repo import Repo
  3. from dulwich.cloud.gcs import GcsObjectStore
  4. import tempfile
  5. from google.cloud import storage
  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)