google-cloud-platform - 通过服务帐户使用 Google Cloud Source Repositories

标签 google-cloud-platform service-accounts gcloud-cli google-cloud-source-repos

是否可以访问 Google Cloud Source Repository以自动化的方式,即从使用 service account 的 GCE 实例?

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

最佳答案

如果您想使用 git 克隆而不是通过 gcloud 运行,您可以运行:

git config --global credential.helper gcloud.sh

...然后这就会起作用:

git clone https://source.developers.google.com/p/$PROJECT/r/$REPO

关于google-cloud-platform - 通过服务帐户使用 Google Cloud Source Repositories,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32073764/

相关文章:

gcloud - 沉默 `gcloud auth activate-service-account`

google-cloud-storage - 我想使用 gcs 将多个域链接到一个存储桶

kubernetes - Google Kubernetes Engine:还原服务帐户

google-cloud-platform - Google Cloud Run - 使用 Eventarc API 触发(资源名称语法)

python - 来自 Python Bigquery 客户端的引用不起作用

c# - 批量请求 - SendAs 电子邮件

gcloud - 我可以使用服务帐户和用户凭据对 gcloud cli 进行身份验证吗?

google-bigquery - 从基于用户的配置文件更新

google-app-engine - 如何备份 Google App Engine 全文搜索文档?

node.js - NodeMailer - G-Suite - 服务账户 - 以群组邮件形式发送