Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 456
derekbaker783 Avatar asked May 15 '20 21:05

derekbaker783


People also ask

How do I change gcloud project from command line?

Check the available projects by running: gcloud projects list . This will give you a list of projects which you can access. To switch between projects: gcloud config set project <project-id> . Show activity on this post.


1 Answers

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

like image 96
derekbaker783 Avatar answered Sep 29 '22 18:09

derekbaker783