From 09143d16433d45c52369d8fb1ca5cd5b191c4672 Mon Sep 17 00:00:00 2001 From: Josh W Lewis Date: Wed, 21 Feb 2024 11:32:48 -0600 Subject: [PATCH] Update tag deletion to v2 url --- bin/publish-to-registries.sh | 2 +- bin/unpublish-temp-tags.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/publish-to-registries.sh b/bin/publish-to-registries.sh index fbc6afa6..fc62c521 100755 --- a/bin/publish-to-registries.sh +++ b/bin/publish-to-registries.sh @@ -27,7 +27,7 @@ push_group() { done } -tempTagSuffix=".temp_${GITHUB_RUN_ID}" +tempTagSuffix=".temp-${GITHUB_RUN_ID}" # build+push to a temporary tag (e.g. heroku/heroku:22.temp_12345678) bin/build.sh "${STACK_VERSION}" "${tempTagSuffix}" diff --git a/bin/unpublish-temp-tags.sh b/bin/unpublish-temp-tags.sh index 344336ac..b9851050 100755 --- a/bin/unpublish-temp-tags.sh +++ b/bin/unpublish-temp-tags.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -set -x dockerhub_token=$(curl -s -f -H "Content-Type: application/json" -X POST -d "{\"username\": \"${DOCKER_HUB_USERNAME}\", \"password\": \"${DOCKER_HUB_TOKEN}\"}" https://hub.docker.com/v2/users/login/ | jq -r .token) @@ -16,16 +15,17 @@ unpublish_group() { echo "Deleting heroku/heroku:${stackVersion}${variant}${targetTagSuffix}" code=$(curl -s -f -X DELETE \ -H "Authorization: JWT ${dockerhub_token}" --write-out "%{http_code}" \ - "https://hub.docker.com/v2/repositories/heroku/heroku/tags/${stackVersion}${variant}${targetTagSuffix}/" + "https://hub.docker.com/v2/namespaces/heroku/repositories/heroku/tags/${stackVersion}${variant}${targetTagSuffix}" ) + echo "status: ${code}" if (( code != 404 )) || (( code != 200 )) || (( code != 201 )); then - echo "Couldn't delete heroku/heroku:${stackVersion}${variant}${targetTagSuffix}: ${code}" + echo "Couldn't delete heroku/heroku:${stackVersion}${variant}${targetTagSuffix}" fi done } stackVersion="${1:-$STACK_VERSION}" -tempTagSuffix="${2:-".temp_$GITHUB_RUN_ID"}" +tempTagSuffix="${2:-".temp-$GITHUB_RUN_ID"}" # delete each tag in a group on Docker Hub. unpublish_group "${stackVersion}" "${tempTagSuffix}"