2017-12-15 5 views
0

私はGithub、AとBの2つのプライベートレポジトリを持っています。どちらもGolangプロジェクトです。プロジェクトAはリポジトリBに依存します。私は両方のリポジトリをGoogleソースコードにリンクし、権限に同意しました。クラウドビルダー内のプライベートGithubリポジトリにアクセスするにはどうすればよいですか?

Cloudbuild.yaml

- name: 'gcr.io/cloud-builders/git' 
    args: ['clone', 'https://source.developers.google.com/p/$PROJECT_ID/r/B'] 

ログコンテナビルダーから

Starting Step #0 
Step #0: Already have image (with digest): gcr.io/cloud-builders/git 
Step #0: Cloning into 'B'... 
Finished Step #0 

... 

Step #1: [0;33m[WARN] [mUnable to checkout github.com/user/B 
Step #1: [0;31m[ERROR] [mUpdate failed for github.com/user/B: Unable to get repository: Cloning into '/builder/home/.glide/cache/src/B'... 
Step #1: fatal: could not read Username for 'https://github.com': No such device or address 
Step #1: : exit status 128 

誰でもコンテナビルダーとグーグル独自のソースリポジトリで動作するように滑空持っていますか?私はこの問題を解決するために「クラウドキー管理サービス」を使用したくありません。

はすでにみました:https://github.com/GoogleCloudPlatform/cloud-builders/issues/44#issuecomment-325144047

答えて

1

私は、クラウドの構築経験がないが、あなたは、sshを使用する必要があり://、httpsではなく://あなたのgitリポジトリをクローニングするため。レポにSSHキーを追加する必要があります(リポジトリごとまたはユーザーアカウント用のデプロイキーと呼ばれる)。クローン作成時に同じキーを使用する必要があります(Linuxでは通常、プライベートキーファイルを〜/ .ssh)。私はクラウドKMSに関わるソリューションが同じことをしているが、秘密鍵を安全に保管していると思います。

関連する問題