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.

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

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建