Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Is it possible to get the latest release name by gcloud cli?

I want to promote a release from environment A to environment B through cli. However, I looked through the 'gcloud deploy releases/rollouts/targets' and could not figure out how to get the latest success release name. Thanks.

Solved Solved
0 2 368
1 ACCEPTED SOLUTION

Hi @pwei100 ,

This gcloud command should promote the last successful release against a target:

gcloud deploy releases promote --release=$(gcloud deploy targets describe dev --delivery-pipeline=$the_pipeline --region=$the_region --format="value('Latest release')") --delivery-pipeline=$the_pipeline --region=$the_region

Does this help?

View solution in original post

2 REPLIES 2

Hi @pwei100 ,

This gcloud command should promote the last successful release against a target:

gcloud deploy releases promote --release=$(gcloud deploy targets describe dev --delivery-pipeline=$the_pipeline --region=$the_region --format="value('Latest release')") --delivery-pipeline=$the_pipeline --region=$the_region

Does this help?

Yes, that's what I need.