doutan2111 2017-12-15 15:22
浏览 59
已采纳

如何访问云构建器中的私有Github存储库?

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 128

Have 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

  • 写回答

1条回答 默认 最新

  • douxie2029 2017-12-15 18:43
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度