diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e10109c89554318641a386be71b0896b3960c83b..2ce316a38f4c7e0bbdb5b77bb36ce3a6d7c75fb1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,8 @@ variables: DOC_VERSION: "1.8" APP_VERSION: "1.8.0" CHART_VERSION: "1.8.0" - SUPPORTED_VERSIONS: "[\"1.7.0\",\"1.7.1\",\"1.7.2\",\"1.8.0\"]" + 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" CACHE_FALLBACK_KEY: "${CI_DEFAULT_BRANCH}" # This will supress any download for dependencies and plugins or upload messages which would clutter the console log. # `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work. diff --git a/.gitlab/check-supported-images.sh b/.gitlab/check-supported-images.sh new file mode 100755 index 0000000000000000000000000000000000000000..645f83200c604a8f00177e0a8f6427cdeb9967d8 --- /dev/null +++ b/.gitlab/check-supported-images.sh @@ -0,0 +1,20 @@ +#!/bin/bash +echo "Starting registry check ..." + +VERSIONS=(${SUPPORTED_VERSIONS//,/ }) +SERVICES=(${MAINTAINED_SERVICES//,/ }) + +for SERVICE in "${SERVICES[@]}"; do + TAGS=$(regctl tag ls "${CI_REGISTRY2_URL}/${SERVICE}") + for VERSION in "${VERSIONS[@]}"; do + if [[ "$VERSION" == "$APP_VERSION" ]]; then + continue + fi + if [[ ! "${TAGS[*]}" =~ $VERSION ]]; then + >&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 diff --git a/.gitlab/remove-unsupported-images.sh b/.gitlab/remove-unsupported-images.sh index ccfe3f7df828e6f4b6ec5279b894ea842a2efe9f..9b51ba3faaf4e3dd79a887a59ed3db899f1aef04 100755 --- a/.gitlab/remove-unsupported-images.sh +++ b/.gitlab/remove-unsupported-images.sh @@ -1,26 +1,28 @@ #!/bin/bash -declare -A services -services[0]=analyse-service -services[1]=auth-service-init -services[2]=dashboard-service -services[3]=data-service -services[4]=metadata-service -services[5]=search-db -services[6]=search-service -services[7]=search-service-init -services[8]=storage-service-init -services[9]=ui - echo "Starting registry housekeeping ..." -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 +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//,/ }) + +for SERVICE in "${SERVICES[@]}"; do + TAGS=$(regctl tag ls "registry.datalab.tuwien.ac.at/dbrepo/${SERVICE}") + TAGS=(${TAGS//\n/ }) + for TAG in "${TAGS[@]}"; do + if [[ ! "${VERSIONS[*]}" =~ $TAG ]]; then + echo "===> ${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