chore(rel): also push promoted images on GAR (#62004)

This commit is contained in:
Jean-Hadrien Chabran 2024-04-18 15:34:42 +02:00 committed by GitHub
parent 811f251e12
commit cd077e5dba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -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{

View File

@ -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