この手順は、Google で GitHub Enterprise ソースコードのリポジトリを使用するアプリケーション開発者、プラットフォーム管理者、セキュリティ管理者を対象としています。 具体的には、 Gemini Code Assist で GitHub Enterprise リポジトリを使用できます。
Developer Connect の詳細については、 Developer Connect の概要をご覧ください。
始める前に
-
ログイン Google アカウントにログインします。
Google アカウントをまだお持ちでない場合は、 新しいアカウントを登録します。
-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Developer Connect API.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Developer Connect API.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
GitHub Enterprise のアカウントにアクセスできることを確認します。
チームの作業を安全に保つため、このガイドの手順は、個人用アカウントではなく、ボット アカウントまたはチームで共有するアカウントを使用して完了することをおすすめします。
- GitHub Enterprise リポジトリを所有しているか、共有リポジトリに対する管理者レベルの権限があることを確認します。
GitHub Enterprise 組織でリポジトリを使用する場合は、 GitHub アプリ マネージャーの権限があることを確認します。
- 省略可: Developer Connect が作成する認証シークレットを暗号化するための顧客管理の 暗号鍵(CMEK)を作成します。
- 省略可: このガイドのコマンドラインの手順を使用するには、次の操作を行います。
- Google Cloud CLI をインストールする。すでに gcloud CLI をインストールしている場合は、
gcloud components updateを実行して、最新のバージョンがインストールされていることを確認します。 - 次のコマンドを実行して、Developer Connect サービス アカウント
を作成します。PROJECT_ID はGoogle Cloud プロジェクト IDです:
gcloud beta services identity create \ --service=developerconnect.googleapis.com \ --project=PROJECT_ID
- Google Cloud CLI をインストールする。すでに gcloud CLI をインストールしている場合は、
Developer Connect を有効にすると、 Secret Manager API も有効になります。
必要な IAM 権限を付与する
接続とリンクの作成に必要な権限を取得するには、管理者に次の IAM のロールを付与するよう依頼してください。
-
プロジェクト オーナーでない場合:
Developer Connect 管理者 (
roles/developerconnect.admin) ユーザー アカウントに対する -
CMEK を使用して Developer Connect が作成するシークレットを暗号化する場合:
Cloud KMS CryptoKey の暗号化/復号 (
roles/cloudkms.cryptoKeyEncrypterDecrypter) Secret Manager サービス アカウントに対する権限。 -
gcloud CLI を使用してこのガイドの手順を完了する場合:
Secret Manager 管理者ロール (
roles/secretmanager.admin) Developer Connect サービス アカウントに対する。 -
コンソールを使用してこのガイドの手順を完了する場合:
ユーザー アカウントに対するプロジェクト IAM 管理者 (
roles/resourcemanager.projectIamAdmin)。 Google Cloud
ロールの付与については、プロジェクト、フォルダ、組織へのアクセス権の管理をご覧ください。
必要な権限は、カスタム ロールや他の事前定義 ロールから取得することもできます。
接続を作成する
このセクションでは、Developer Connect と GitHub Enterprise の間の接続を作成する方法について説明します。コンソールを使用している場合は、接続の設定が完了したら、リポジトリへのリンクの追加を開始することもできます。 Google Cloud
新しい GitHub Enterprise 接続を作成するには、次のいずれかのオプションを選択します。
コンソール
次の手順で接続を開始します。
コンソールで [Developer Connect] を開きます。 Google Cloud
Developer Connect に [Git リポジトリ] ページが表示されます。
- ソースコード管理プロバイダのリストが表示される場合: ソースコード管理プロバイダを選択して、最初の接続の設定を開始します。GitHub Enterprise カードで [接続] をクリックします。
既存の接続のリストが表示される場合: [接続を作成] > [GitHub Enterprise] をクリックして、ソースコード管理プロバイダを設定します。
[接続を作成] ページが開きます。
[