2017-05-23 28 views
0

我正在嘗試在我的谷歌cloud container builder設置中添加構建步驟。將角色/範圍添加到Google雲容器構建器中?

該步驟將根據源樹中提供的index.yaml文件爲我的項目創建數據存儲區索引。

基本上我有這個cloudbuild.yml:

steps: 
- name: gcr.io/cloud-builders/gcloud 
    args: ["datastore", "create-indexes", "index.yaml", "-q"] 

當我運行此我從gcloud工具這個錯誤:

錯誤:(gcloud.datastore.create的索引)您目前使用沒有適當訪問****的服務帳戶登錄到gcloud。該帳戶具有以下範圍:https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/projecthosting,https://www.googleapis.com/auth/pubsubhttps://www.googleapis.com/auth/devstorage.read_write。它需要https://www.googleapis.com/auth/cloud-platform才能成功。 請使用缺失的作用域重新創建此VM實例。您也可以使用gcloud auth login登錄到具有相應訪問權限的標準帳戶。

我嘗試將IAM角色「Cloud datastore index admin」添加到項目「@ cloudbuild.gserviceaccount.com」服務帳戶,但這沒有幫助。

是否有一種簡單的方法可以實現此目的,即向容器構建器服務帳戶授予創建數據存儲區索引所需的特權?

回答

0

嘗試添加「雲數據存儲所有者」或「項目編輯器」權限。