我在Github上有两个私有存储库,A和B.两个都是Golang项目。 项目A取决于存储库B.我已将这两个存储库链接到Google源代码并同意权限。
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有没有人能够使用容器生成器和Google自己的源代码库? 我不想使用'云密钥管理服务'来解决这个问题。
已经试过: https : //github.com/GoogleCloudPlatform/cloud-builders/issues/44#issuecomment-325144047
I have two private repositories on Github, A and B. Both are Golang projects. Project A depends on repository B. I have linked both repositories to Google Source Code and consented with permissions.
Cloudbuild.yaml
- name: 'gcr.io/cloud-builders/git' args: ['clone', 'https://source.developers.google.com/p/$PROJECT_ID/r/B']Log from container builder
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 128Have anyone got glide to work with container builder and googles own source repositories? I don't want to use 'Cloud Key Management Service' to solve this issue.
Have already tried: https://github.com/GoogleCloudPlatform/cloud-builders/issues/44#issuecomment-325144047
最满意答案
我没有使用云构建的经验,但是您应该使用ssh://而不是https://来克隆您的git存储库。 那么你需要在repo中添加一个SSH密钥(在github中称为部署密钥,每个repo或你的用户帐户)并在克隆时使用相同的密钥(在Linux中通常足以将私钥文件放在的〜/ .ssh)。 我想你可能发现哪些涉及云KMS的解决方案可以做同样的事情,但安全地存储私钥。
I have no experience with cloud build but you should use ssh:// instead of https:// for cloning your git repository. then you'll need to add a SSH key to the repo (in github its called deploy keys, either per repo or for your user account) and use the same key when cloning (in Linux its usually enough to put the private key file under ~/.ssh). I guess that solutions you may found which involve Cloud KMS do the same thing but store the private key securely.
更多推荐
发布评论