2

git에서 파일을 Google 클라우드 저장소 버킷에 직접 업로드 할 수있는 방법이 있습니까?git에서 Google 클라우드 저장소 버킷으로 파일 전송

나는 아래의 명령을 사용하여 시도했다 :

gsutil cp https://Link.git gs://bucketname 

을하지만 같이 나에게 오류를 제공합니다

InvalidUrlError: Unrecognized scheme "https".

나는이 콘텐츠를 업로드 할 수있는 다른 방법이 있나요?

도움을 주시면 감사하겠습니다.

답변

1

google-cloud-sdk/platform/gsutil/gslib/storage_url.py에, 후드 쇼에서 엿, 오류 메시지에 대한 (가능성이) 트리거 당신이있어 :

def _GetSchemeFromUrlString(url_str): 
    """Returns scheme component of a URL string.""" 

    end_scheme_idx = url_str.find('://') 
    if end_scheme_idx == -1: 
    # File is the default scheme. 
    return 'file' 
    else: 
    return url_str[0:end_scheme_idx].lower() 

[...]

def StorageUrlFromString(url_str): 
    """Static factory function for creating a StorageUrl from a string.""" 

    scheme = _GetSchemeFromUrlString(url_str) 

    if scheme not in ('file', 's3', 'gs'): 
    raise InvalidUrlError('Unrecognized scheme "%s"' % scheme) 

은 기본적으로 도구가되지 않습니다 일반 URL을 지원합니다.

당연히 - 실제로 git repo에서 직접 복사를 지원하기 위해 도구를 강화할 수 있습니다. 그러나 데이지 체인 모드에서만 작동한다는 점에 유의해야합니다. Options에서 :

-D

Copy in "daisy chain" mode, i.e., copying between two buckets by hooking a download to an upload, via the machine where gsutil is run. This stands in contrast to the default, where data are copied between two buckets "in the cloud", i.e., without needing to copy via the machine where gsutil runs.

[...]

Note: Daisy chain mode is automatically used when copying between providers (e.g., to copy data from Google Cloud Storage to another provider).

그러나

데이터는 해당 지역의 repo에서 업로드 할 수정되지 않은 gsutil를 사용 후 그냥 로컬 자식의 repo를 복제하는 아마 간단 gsutil를 실행하는 로컬 컴퓨터를 통과 할 것 같은 경우 이후 버킷에 :