Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions owlbot-postprocessor/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ steps:
args:
- '-c'
- |
PREV_DIGEST=$(gcloud container images list-tags gcr.io/cloud-devrel-public-resources/owlbot-ruby --filter="tags=latest" --format="value(digest)" 2>/dev/null || true)
if [ ! -z "$PREV_DIGEST" ]; then
HEX_DIGEST=${PREV_DIGEST#sha256:}
echo "Previous latest digest found: $PREV_DIGEST. Adding deprecation tag..."
gcloud container images add-tag gcr.io/cloud-devrel-public-resources/owlbot-ruby@$PREV_DIGEST gcr.io/cloud-devrel-public-resources/owlbot-ruby:deprecated-public-image-$HEX_DIGEST --quiet
PREV_DIGEST=$$(gcloud container images list-tags gcr.io/cloud-devrel-public-resources/owlbot-ruby --filter="tags=latest" --format="value(digest)" 2>/dev/null || true)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we could validate the execution here with an artifact (perhaps by adding a dry-run flag or something to just confirm the command)

if [ ! -z "$$PREV_DIGEST" ]; then
HEX_DIGEST=$${PREV_DIGEST#sha256:}
echo "Previous latest digest found: $$PREV_DIGEST. Adding deprecation tag..."
gcloud container images add-tag gcr.io/cloud-devrel-public-resources/owlbot-ruby@$$PREV_DIGEST gcr.io/cloud-devrel-public-resources/owlbot-ruby:deprecated-public-image-$$HEX_DIGEST --quiet
else
echo "No previous latest image found to deprecate."
fi
Expand Down
Loading