简体   繁体   English

使用“gcloud run deploy”时,如何使用命令行参数指定服务名称?

[英]When using 'gcloud run deploy', how can I specify the service name with command line args?

When using gcloud run deploy , how can I specify the service name with command-line args?使用gcloud run deploy时,如何使用命令行参数指定服务名称? I'm hoping to prevent the need for interactivity at deploy-time.我希望避免在部署时需要交互。

I'm currently deploying my service like so:我目前正在像这样部署我的服务:

gcloud run deploy --image gcr.io/<PROJECT>/<TAG> --platform managed

There is a service parameter, which is positional as opposed to named.有一个服务参数,它是定位的而不是命名的。

From the docs:从文档:

gcloud run deploy [[SERVICE] --namespace=NAMESPACE] etc...

So you could do this:所以你可以这样做:

gcloud run deploy <SERVICE_NAME> --image gcr.io/<PROJECT>/<TAG> --platform managed

https://cloud.google.com/sdk/gcloud/reference/run/deploy#POSITIONAL-ARGUMENTS https://cloud.google.com/sdk/gcloud/reference/run/deploy#POSITIONAL-ARGUMENTS

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以运行 gcloud compute instances get-guest-attributes 命令只提供“ProjectName”(或)“zoneName”而不提供计算实例名称吗 - Can I run gcloud compute instances get-guest-attributes command with only providing "ProjectName" (or) "zoneName" without compute instance name gcloud beta 构建触发器运行 - 为什么指定分支名称 - gcloud beta builds triggers run - why specify branch name 如何使用 gcloud 命令使用 accessConfig 创建 GCP 实例模板 - How to create GCP Instance-Template with accessConfig using gcloud command 当我尝试部署端点配置时,gcloud 抛出 PERMISSION_DENIED - gcloud throws PERMISSION_DENIED when I try to deploy endpoint configuration 如何在 gcloud 中使用访问令牌 - How can I use an access token with gcloud 部署 Firebase 云函数时如何修复命令行错误 supportedNodeVersions? - How can I fix command line error supportedNodeVersions when deploying Firebase cloud functions? 无法部署 Firebase 函数(无法获取未定义的运行服务) - Can't deploy Firebase functions (Failed to fetch Run service undefined) 如何修复错误:(gcloud.functions.deploy)PERMISSION_DENIED:权限'run.services.setIamPolicy'拒绝资源' - How to fix ERROR: (gcloud.functions.deploy) PERMISSION_DENIED: Permission 'run.services.setIamPolicy' denied on resource ' 使用 gcloud 服务帐号登录 firebase - Login to firebase using gcloud service account 在本地使用 Intellij Cloud Code Cloud Run 时如何指定 GOOGLE_APPLICATION 凭据? - How to specify GOOGLE_APPLICATION credentials when using Intellij Cloud Code Cloud Run locally?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM