【发布时间】:2021-06-17 06:32:15
【问题描述】:
我正在使用 git_short_sha 和 branch_name 以及其他一些标签来标记我的图像。我正在尝试使用 gcloud 命令获取带有 master 标记的图像的 short_sha 标记。 我已经设法使用这些命令获取所有标签或特定标签的位置:
1. gcloud container images list-tags eu.gcr.io/${PROJECT_ID}/${IMAGE} --format='value(tags[1])' --filter="tags=master"
result:
76f1a2a
但我不能确定第二个元素将始终是 short_sha。
2. gcloud container images list-tags eu.gcr.io/${PROJECT_ID}/${IMAGE} --format='value(tags)' --filter="tags=master"
result:
1.0.0-master,76f1a2a,76f1a2a-master,master
仅使用gcloud命令是否可以仅获取short_sha标签?
【问题讨论】:
标签: google-cloud-platform gcloud google-container-registry