Google Cloud SDK https://cloud.google.com/sdk/docs/上的文档指示gcloud init安装后运行。
gcloud init鉴于这是一个交互式命令,有没有办法自动执行此步骤?
Google Cloud SDK https://cloud.google.com/sdk/docs/上的文档指示gcloud init安装后运行。
gcloud init鉴于这是一个交互式命令,有没有办法自动执行此步骤?
一个不需要运行gcloud init。主要目标是确保配置了凭据,并且可能设置了项目属性。如果您有服务帐户凭据,则可以通过以下方式配置并准备好 gcloud:
gcloud auth activate-service-account --key-file=credential_key.json
gcloud config set project my-project
为了完整gcloud init起见,基本上运行以下步骤:
gcloud config configurations create my_configurationgcloud config configurations activate my_configurationgcloud auth logingcloud config set account my_existing_credentialsgcloud auth activate-service-accountgcloud config set project my_project
gcloud projects listgcloud config set compute/zone my_default_gce_zone
gcloud compute zones listgcloud config set compute/region my_default_gce_region
gcloud compute regions listgsutil config -n -o ~/.boto