From 516247bd2282f58892dd6b49aa5c9c0e15e4c071 Mon Sep 17 00:00:00 2001 From: Martin Weise <martin.weise@tuwien.ac.at> Date: Wed, 2 Apr 2025 20:51:39 +0200 Subject: [PATCH] WIP Signed-off-by: Martin Weise <martin.weise@tuwien.ac.at> --- .gitlab/check-supported-images.sh | 7 +++++-- .gitlab/remove-unsupported-images.sh | 19 +++---------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.gitlab/check-supported-images.sh b/.gitlab/check-supported-images.sh index 645f83200c..4b14ccb14b 100755 --- a/.gitlab/check-supported-images.sh +++ b/.gitlab/check-supported-images.sh @@ -1,6 +1,10 @@ #!/bin/bash echo "Starting registry check ..." +SUPPORTED_VERSIONS="1.7.3, 1.8.0" +MAINTAINED_SERVICES="analyse-service, auth-service-init, dashboard-service, dashboard-service-init, data-service, metadata-service, search-db, search-service, search-service-init, storage-service-init, ui" +CI_REGISTRY2_URL="registry.datalab.tuwien.ac.at/dbrepo" + VERSIONS=(${SUPPORTED_VERSIONS//,/ }) SERVICES=(${MAINTAINED_SERVICES//,/ }) @@ -14,7 +18,6 @@ for SERVICE in "${SERVICES[@]}"; do >&2 echo "[ERROR] Failed to find image: ${CI_REGISTRY2_URL}/${SERVICE}:${VERSION}" exit 1 fi - echo "[DEBUG] Found image: ${CI_REGISTRY2_URL}/${SERVICE}:${VERSION}" done - echo "[INFO] Finished successfully." done +echo "[INFO] Finished successfully." diff --git a/.gitlab/remove-unsupported-images.sh b/.gitlab/remove-unsupported-images.sh index 7fb90b75a2..141246e5da 100755 --- a/.gitlab/remove-unsupported-images.sh +++ b/.gitlab/remove-unsupported-images.sh @@ -1,30 +1,17 @@ #!/bin/bash echo "Starting registry housekeeping ..." -SUPPORTED_VERSIONS="1.7.3, 1.8.0" -MAINTAINED_SERVICES="analyse-service, auth-service-init, dashboard-service, dashboard-service-init, data-service, metadata-service, search-db, search-service, search-service-init, storage-service-init, ui" VERSIONS=(${SUPPORTED_VERSIONS//,/ }) SERVICES=(${MAINTAINED_SERVICES//,/ }) -CI_REGISTRY2_URL="registry.datalab.tuwien.ac.at/dbrepo" - for SERVICE in "${SERVICES[@]}"; do TAGS=$(regctl tag ls "${CI_REGISTRY2_URL}/${SERVICE}") TAGS=(${TAGS//\n/ }) for TAG in "${TAGS[@]}"; do if [[ ! "${VERSIONS[*]}" =~ $TAG ]]; then - echo "===> ${TAG}" + regctl tag rm ${CI_REGISTRY2_URL}/${SERVICE}:$TAG + echo "[INFO] Deleted unsupported tag ${CI_REGISTRY2_URL}/${SERVICE}:$TAG" fi done done -#for key in "${!services[@]}"; do -# echo "Checking ${CI_REGISTRY2_URL}/${services[$key]} tags ..." -# TAGS=$(regctl tag ls ${CI_REGISTRY2_URL}/${services[$key]}) -# for tag in $TAGS; do -# res=$(echo "${SUPPORTED_VERSIONS}" | grep "$tag") -# if [[ -z $res ]]; then -# regctl tag rm ${CI_REGISTRY2_URL}/${services[$key]}:$tag -# echo "Deleted unsupported tag ${CI_REGISTRY2_URL}/${services[$key]}:$tag" -# fi -# done -#done +echo "[INFO] Finished successfully." -- GitLab