使用带有服务帐户的Google Cloud Source存储库 [英] Using Google Cloud Source Repositories with service account

查看:290
本文介绍了使用带有服务帐户的Google Cloud Source存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以访问 Google Cloud Source Repository ,即使用服务帐户从GCE实例中获取?

我在文档中看到的唯一身份验证方法是使用 gcloud auth login 命令,该命令将进行身份验证我的个人用户访问repo,而不是我正在运行命令的机器。

解决方案

关于GCE vms运行

  gcloud来源回购克隆默认〜/ my_repo 

应自动工作,无需额外的验证步骤,因为它将使用虚拟机服务帐户。



如果您在其他机器上运行,您可以从 https://console.cloud.g oogle.com 服务帐户.json密钥文件并使用

  gcloud auth activate-service-account  - key_file 

,然后运行上面的clone命令。


Is it possible to access a Google Cloud Source Repository in an automated way, i.e. from a GCE instance using a service account?

The only authentication method I am seeing in the docs is to use the gcloud auth login command, which will authenticate my personal user to access the repo, not the machine I am running commands from.

解决方案

On GCE vms running

gcloud source repos clone default ~/my_repo

should work automatically without extra step of authentication, as it will use VMs service account.

If you running on some other machine you can download from https://console.cloud.google.com service account .json key file and activate it with

gcloud auth activate-service-account --key-file KEY_FILE

and then run the above clone command.

这篇关于使用带有服务帐户的Google Cloud Source存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆