소스 코드 저장소 연결

Developer Connect를 사용하면 Google 이외의 제품 및 서비스와 통합하여 지원되는 Google 제품에서 사용할 수 있습니다.

이 빠른 시작에서는 Git 저장소 연결을 사용하여 GitHub에 연결하는 방법을 보여줍니다. 이 유형의 연결은 Gemini Code Assist 코드 맞춤설정을 사용하려는 경우에 필요합니다.

Developer Connect에서 지원하는 모든 통합 목록은 Developer Connect 개요를 참고하세요.

시작하기 전에

  1. Google Cloud 계정에 로그인합니다. Google Cloud를 처음 사용하는 경우 계정을 만들고 Google 제품의 실제 성능을 평가해 보세요. 신규 고객에게는 워크로드를 실행, 테스트, 배포하는 데 사용할 수 있는 $300의 무료 크레딧이 제공됩니다.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Developer Connect and Secret Manager APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

  5. Make sure that you have the following role or roles on the project: Developer Connect Admin

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. Click Grant access.
    4. In the New principals field, enter your user identifier. This is typically the email address for a Google Account.

    5. Click Select a role, then search for the role.
    6. To grant additional roles, click Add another role and add each additional role.
    7. Click Save.
  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  7. Verify that billing is enabled for your Google Cloud project.

  8. Enable the Developer Connect and Secret Manager APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

  9. Make sure that you have the following role or roles on the project: Developer Connect Admin

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. Click Grant access.
    4. In the New principals field, enter your user identifier. This is typically the email address for a Google Account.

    5. Click Select a role, then search for the role.
    6. To grant additional roles, click Add another role and add each additional role.
    7. Click Save.
  10. GitHub 계정이 있고 GitHub.com에 호스팅된 저장소에 액세스할 수 있는지 확인합니다. 또는 GitHub 문서를 따라 새 저장소를 만드세요.
  11. 기존 저장소를 사용하고 있고 소유자가 아닌 경우 소유자에게 저장소에 대한 관리자 수준 권한을 부여해 달라고 요청합니다. 저장소가 GitHub 조직에 있는 경우 조직 소유자에게 관리자 수준 권한을 요청합니다. GitHub 조직에 대해 자세히 알아보려면 GitHub 계정 유형을 참고하세요.

연결 시작

  1. Google Cloud 콘솔에서 Developer Connect 페이지를 엽니다.

    Developer Connect로 이동

    Git 저장소 페이지가 열리고 소스 코드 관리 제공업체 목록이 표시됩니다.

  2. 해당 제공업체의 카드에서 연결을 클릭하여 소스 코드 관리 제공업체를 선택합니다.

    연결 만들기 페이지가 열립니다.

  3. 리전으로 us-central1를 선택합니다.

  4. 이름으로 quickstart-connection를 입력합니다.

  5. 계속을 클릭합니다.

    GitHub OAuth 토큰을 사용할 수 있는 권한을 요청하는 Google Developer Connect 대화상자가 표시됩니다.

    대화상자가 표시되지 않으면 팝업 차단 브라우저 플러그인을 사용 중지하고 브라우저 설정에서 팝업을 허용하는지 확인하세요. 예를 들어 Chrome에서 팝업을 허용하는 안내를 따릅니다.

  6. 이해했으며 계속합니다를 클릭합니다.

  7. 메시지가 표시되면 GitHub 계정 로그인 단계를 완료합니다.

  8. 메시지가 표시되면 개발자 연결 승인을 클릭합니다. 이 메시지가 표시되지 않으면 이 계정에 이미 승인이 부여된 것입니다.

연결 구성

다음 단계에 따라 GitHub 계정 및 저장소에 권한을 부여합니다. 메시지는 GitHub 계정을 사용하는 사용자가 GitHub에 Google Developer Connect 앱을 이미 설치했는지에 따라 달라집니다.

  • GitHub 계정 목록이 표시되는 경우: 아직 앱이 설치되지 않은 것입니다. 다음 단계에 따라 설치하고 구성하세요.

    1. 연결할 저장소에 액세스할 수 있는 GitHub 계정을 선택합니다.

    2. GitHub 저장소 권한을 지정하고 앱을 설치합니다. 자세한 내용은 앱 설치에 관한 GitHub 안내를 참고하세요.

  • 기존 설치를 재사용하라는 메시지가 표시되는 경우: 다음 단계에 따라 앱을 설치하고 구성할 위치를 선택합니다.

    1. GitHub 계정을 클릭하여 앱이 설치된 계정을 확인합니다. 사용하려는 계정이 표시되면 선택합니다.

      1. 확인을 클릭합니다.
    2. 사용하려는 계정이 표시되지 않으면 다른 GitHub 계정에 GitHub 앱 설치를 선택합니다.

      1. 확인을 클릭합니다.

      2. 사용할 GitHub 계정을 선택합니다.

      3. GitHub 저장소 권한을 지정하고 앱을 설치합니다. 자세한 내용은 앱 설치에 관한 GitHub 안내를 참고하세요.

  1. 저장소에서 연결할 저장소를 선택합니다.

  2. 링크를 클릭합니다.

연결이 연결 목록에 추가되고 연결된 저장소가 저장소 목록에 추가됩니다.

삭제

이 페이지에서 사용한 리소스 비용이 Google Cloud 계정에 청구되지 않도록 하려면 다음 단계를 수행합니다.

  1. Google Cloud 콘솔에서 Developer Connect 페이지로 이동합니다.

    Developer Connect로 이동

  2. 저장소 탭에서 연결된 저장소의 이름이 포함된 행에서 옵션 더보기를 클릭합니다.

  3. 연결 해제를 선택합니다.

  4. 확인을 클릭합니다.

  5. 연결 탭을 클릭합니다.

  6. 연결 이름이 포함된 행에서 옵션 더보기를 클릭합니다.

  7. 삭제를 선택합니다.

  8. 연결 이름을 입력합니다.

  9. 확인을 클릭합니다.

연결 및 링크를 삭제해도 GitHub.com의 저장소는 삭제되지 않습니다. 이 빠른 시작을 위해 새 GitHub 저장소를 만들었고 저장소를 삭제하려면 GitHub 안내에 따라 저장소를 삭제하세요.

Google Developer Connect 앱을 제거하려면 설치된 앱 수정에 관한 GitHub 안내를 따르세요.

다음 단계