2024년 6월 17일부터 신규 고객은 Cloud Source Repositories를 사용할 수 없습니다. 이전에 조직에서 Cloud Source Repositories를 사용한 적이 없는 경우 API를 사용 설정할 수 없거나 Cloud Source Repositories를 사용할 수 없습니다. 조직에 연결되지 않은 새 프로젝트는 Cloud Source Repositories API를 사용 설정할 수 없습니다. 2024년 6월 17일 이전에 Cloud Source Repositories를 사용한 조직은 이 변경사항의 영향을 받지 않습니다.
이 주제에서는 Bitbucket 저장소를 Cloud Source Repositories에 미러링하는 방법을 설명합니다. 이 구성을 사용하면 Bitbucket 저장소로 푸시한 커밋이 Cloud Source Repositories에서 호스팅된 저장소로 복사 또는 미러링됩니다.
Bitbucket Cloud 및 GitHub Cloud 저장소만 Cloud Source Repositories에 미러링할 수 있습니다. 자체 호스팅 Bitbucket 및 GitHub 미러링은 지원되지 않습니다.
Bitbucket 저장소를 Cloud Build와 통합할 Cloud Source Repositories에 미러링하고 다른 Cloud Source Repositories 기능은 필요하지 않은 경우에는 대신 Bitbucket Cloud에서 저장소 빌드에 대한 Cloud Build 안내를 따릅니다.
시작하기 전에
저장소를 미러링하려면 Bitbucket 사용자 인증 정보를 제공해야 합니다. 이러한 사용자 인증 정보를 통해 Cloud Source Repositories가 Bitbucket 저장소 콘텐츠에 액세스할 수 있습니다.
특별히 저장소 미러링과 같은 자동화 작업 전용으로 Bitbucket 계정을 만드는 것이 좋습니다. 이 계정에 저장소에 대한 관리 액세스 권한이 있어야 합니다.
Bitbucket 저장소 미러링
이 섹션에서는 Bitbucket 저장소를 Cloud Source Repositories에 미러링하는 방법을 보여줍니다.
미러링된 저장소 만들기
이 프로세스에서Google Cloud 에 Bitbucket 저장소에 대한 읽기 액세스 권한을 부여하려면 Bitbucket 머신 사용자 인증 정보가 필요합니다.
체크박스를 선택하여 Cloud Source Repositories에 사용자 인증 정보를 저장하도록 승인합니다.
Bitbucket에 연결을 클릭합니다.
머신 사용자 인증 정보를 사용하여 Bitbucket에 로그인합니다.
Google Cloud Platform 승인을 클릭합니다.
이 옵션은 저장소에 대한 읽기 액세스 권한을 부여합니다. Google Cloud
승인이 완료되면 외부 저장소 연결 페이지로 돌아갑니다. 저장소 목록이 열립니다.
저장소 목록에서 미러링할 저장소를 선택합니다.
선택한 저장소 연결을 클릭합니다.
기본 저장소 페이지가 열립니다. 이 페이지에는 방금 만든 새 저장소를 포함하여 이 Google Cloud 프로젝트의 저장소 목록이 포함됩니다.
Bitbucket 저장소 식별
Cloud Source Repositories에서는 Bitbucket 저장소의 미러링된 저장소를 식별할 수 있습니다.
각 Bitbucket 저장소에 Bitbucket 로고가 표시됩니다.
저장소 이름의 시작 부분에 bitbucket_이 추가됩니다.
Bitbucket 연결 업그레이드
이전Google Cloud 콘솔 인터페이스를 사용하여 Bitbucket 저장소를 미러링한 경우 현재Google Cloud 콘솔에서 미러링된 저장소에 액세스할 때 Cloud Source Repositories에는 업그레이드할지 묻는 메시지가 표시됩니다. 이러한 메시지는 업그레이드가 완료될 때까지 저장소에 액세스할 때마다 표시됩니다.
연결을 업그레이드하려면 소스 저장소 관리자 역할이 있어야 합니다. 연결을 업그레이드해도 Bitbucket 저장소의 미러링 동작은 변경되지 않습니다.
미러링을 설정한 후에는 사용자가 변경사항을 커밋할 때 Cloud Source Repositories에서 자동으로 저장소를 미러링된 저장소와 동기화합니다.
Cloud Source Repositories에서는 미러링된 저장소가 마지막으로 동기화된 시간을 확인하고 필요한 경우 직접 동기화 할 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Mirroring a Bitbucket repository\n\nThis topic describes how to mirror a Bitbucket repository to\nCloud Source Repositories. With this configuration, commits that you push to the\nBitbucket repository are copied, or *mirrored*, into a repository hosted in\nCloud Source Repositories.\n\nOnly Bitbucket Cloud and GitHub Cloud repositories can be mirrorred to\nCloud Source Repositories; self-hosted Bitbucket and GitHub mirroring are not\nsupported.\n\nIf you are mirroring your Bitbucket repository to Cloud Source Repositories to integrate\nwith Cloud Build and do not need any other Cloud Source Repositories features,\nfollow the Cloud Build instructions on\n[building repositories from Bitbucket Cloud](/build/docs/automating-builds/build-repos-from-bitbucket-cloud)\ninstead.\n\nBefore you begin\n----------------\n\nWhen you mirror a repository, you must provide Bitbucket authentication\ncredentials. These credentials let Cloud Source Repositories access the\ncontents of the Bitbucket repository.\n\nIt is recommended that you [create a Bitbucket account](https://guides.co/g/bitbucket-101/11151)\nthat is specifically dedicated to automated tasks, such as mirroring a\nrepository. This account must have administrative access to your repository.\n\nMirror a Bitbucket repository\n-----------------------------\n\nThis section shows how to mirror a Bitbucket repository to\nCloud Source Repositories.\n| **Note:** Make sure you're signed out of Bitbucket before you mirror a repository. Signing out helps ensure you select the right Bitbucket account when you connect the Bitbucket repository to Cloud Source Repositories.\n\n### Create a mirrored repository\n\nIn this process, you need your Bitbucket machine user credentials to grant\nGoogle Cloud read access to the Bitbucket repository.\n\n1. In the Google Cloud console, open Cloud Source Repositories.\n\n [Open Cloud Source Repositories](https://source.cloud.google.com/repos)\n2. Click **Add repository**.\n\n The **Add a repository** page opens.\n3. Select **Connect external repository** and click **Continue**.\n\n The **Connect external repository** page opens.\n4. In the **Project** drop-down list, select the Google Cloud project to\n which the mirrored repository belongs.\n\n If you don't have a project, you can click **Create project** to\n [create a project](https://cloud.google.com/source-repositories/docs/creating-an-empty-repository#creating_a_project).\n5. In the **Git provider** drop-down list, select **Bitbucket**.\n\n6. Select the checkbox to authorize Cloud Source Repositories to store your\n credentials.\n\n7. Click **Connect to Bitbucket**.\n\n8. Sign in to Bitbucket with your machine user credentials.\n\n9. Click **Authorize GoogleCloudPlatform**.\n\n This option grants Google Cloud read access to your repository.\n\n When authorization finishes, you're returned to the **Connect external\n repository** page. A list of repositories opens.\n10. From the list of repositories, select the repository you want to mirror.\n\n11. Click **Connect Selected Repository**.\n\n The main repository page opens. This page contains a list of the\n repositories for this Google Cloud project, including the new\n repository you just created.\n\n### Identify Bitbucket repositories\n\nCloud Source Repositories makes it clear which of your repositories are\nmirrors of Bitbucket repositories:\n\n- Each Bitbucket repository is represented with the Bitbucket logo.\n- The name of the repository has `bitbucket_` added to the beginning of its name.\n\nUpgrade a Bitbucket connection\n------------------------------\n\nIf you mirrored a Bitbucket repository by using an earlier\nGoogle Cloud console interface, Cloud Source Repositories prompts you to\nupgrade when you access your mirrored repository in the current\nGoogle Cloud console. Until the upgrade is completed, these prompts occur each\ntime you access the repository.\n\nYou must have the Source Repository Administrator role to upgrade the\nconnection. Upgrading the connection doesn't change the mirroring behavior of\nthe Bitbucket repository.\n| **Note:** Make sure you are signed out of Bitbucket before you upgrade the connection. This helps ensure you can select the right account when you connect the repository to Cloud Source Repositories.\n\n1. In the Google Cloud console, open Cloud Source Repositories.\n\n [Open Cloud Source Repositories](https://source.cloud.google.com/repos)\n2. Navigate to the mirrored Bitbucket repository.\n\n3. When prompted, click **Upgrade Credentials** to upgrade your connection.\n\nForce a repository sync\n-----------------------\n\nAfter you set up mirroring, Cloud Source Repositories automatically syncs\nyour repository with the mirrored repository when a user commits a change.\nCloud Source Repositories lets you to view the last time your mirrored\nrepository was synced and manually force a sync if necessary.\n\n1. In the Google Cloud console, browse to the mirrored Bitbucket repository.\n\n2. Click\n **Settings** *settings*.\n\n The sync status is displayed.\n\n3. To manually force a sync of the repositories, click **Sync from Bitbucket**.\n\n| **Note:** Repositories connected using an older version of the connected repository service may not have these options."]]