From cd077e5dba972ab9765f0af125ca03de40a66501 Mon Sep 17 00:00:00 2001 From: Jean-Hadrien Chabran Date: Thu, 18 Apr 2024 15:34:42 +0200 Subject: [PATCH] chore(rel): also push promoted images on GAR (#62004) --- dev/ci/internal/ci/release_operations.go | 1 + tools/release/promote_images.sh | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dev/ci/internal/ci/release_operations.go b/dev/ci/internal/ci/release_operations.go index b911af61243..602aef02f60 100644 --- a/dev/ci/internal/ci/release_operations.go +++ b/dev/ci/internal/ci/release_operations.go @@ -21,6 +21,7 @@ func releasePromoteImages(c Config) operations.Operation { bk.Env("VERSION", c.Version), bk.Env("INTERNAL_REGISTRY", images.SourcegraphInternalReleaseRegistry), bk.Env("PUBLIC_REGISTRY", images.SourcegraphDockerPublishRegistry), + bk.Env("ADDITIONAL_PROD_REGISTRY", images.SourcegraphArtifactRegistryPublicRegistry), bk.AnnotatedCmd( fmt.Sprintf("./tools/release/promote_images.sh %s", image_args), bk.AnnotatedCmdOpts{ diff --git a/tools/release/promote_images.sh b/tools/release/promote_images.sh index 503dac87cef..a80214d2e97 100755 --- a/tools/release/promote_images.sh +++ b/tools/release/promote_images.sh @@ -15,11 +15,19 @@ fi echo -e "## Release: image promotions" > ./annotations/image_promotions.md echo -e "\n| Name | From | To |\n|---|---|---|" >> ./annotations/image_promotions.md for name in "${@:1}"; do - echo "--- Copying ${name} from private registry to public registry" + echo "--- Copying ${name} from private registry to public registries" + # Pull the internal release docker pull "${INTERNAL_REGISTRY}/${name}:${VERSION}" + + # Push it on the classic public registry (DockerHub) docker tag "${INTERNAL_REGISTRY}/${name}:${VERSION}" "${PUBLIC_REGISTRY}/${name}:${VERSION}" docker push "${PUBLIC_REGISTRY}/${name}:${VERSION}" - echo -e "| ${name} | \`${INTERNAL_REGISTRY}/${name}:${VERSION}\` | \`${PUBLIC_REGISTRY}/${name}:${VERSION}\` |" >>./annotations/image_promotions.md + # We're transitioning to GAR because of DockerHub new rate limiting affecting GCP + # See https://github.com/sourcegraph/sourcegraph/issues/61696 + docker tag "${INTERNAL_REGISTRY}/${name}:${VERSION}" "${ADDITIONAL_PROD_REGISTRY}/${name}:${VERSION}" + docker push "${ADDITIONAL_PROD_REGISTRY}/${name}:${VERSION}" + + echo -e "| ${name} | \`${INTERNAL_REGISTRY}/${name}:${VERSION}\` | \`${PUBLIC_REGISTRY}/${name}:${VERSION}\` \`${ADDITIONAL_PROD_REGISTRY}/${name}:${VERSION}\` |" >>./annotations/image_promotions.md done