简体   繁体   中英

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? 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM