Clean up the test repository from the registry at the end of the test step
Some checks are pending
CI/CD Pipeline / Test Backend (push) Waiting to run
CI/CD Pipeline / Test Frontend (push) Waiting to run
CI/CD Pipeline / Build and Push Docker Images (push) Blocked by required conditions
CI/CD Pipeline / Deploy to Production (push) Blocked by required conditions

This commit is contained in:
continuist 2025-06-28 14:19:24 -04:00
parent bb940ce6f0
commit f721101722

View file

@ -605,10 +605,29 @@ curl http://localhost:5000/v2/test/tags/list
docker rmi localhost:5000/test:latest docker rmi localhost:5000/test:latest
docker pull localhost:5000/test:latest docker pull localhost:5000/test:latest
# Clean up test image # Clean up test image completely
# Remove from local Docker
docker rmi localhost:5000/test:latest docker rmi localhost:5000/test:latest
# Delete test image from registry using registry API
# Get the digest of the latest tag
DIGEST=$(curl -s -H "Accept: application/vnd.docker.distribution.manifest.v2+json" http://localhost:5000/v2/test/manifests/latest | grep -o '"digest":"[^"]*"' | cut -d'"' -f4)
# Delete the manifest from registry
if [ ! -z "$DIGEST" ]; then
echo "Deleting test image from registry..."
curl -X DELETE http://localhost:5000/v2/test/manifests/$DIGEST
else
echo "Could not find digest for test image"
fi
# Clean up test file
rm /tmp/test.Dockerfile rm /tmp/test.Dockerfile
# Verify registry is empty
echo "Registry contents after cleanup:"
curl http://localhost:5000/v2/_catalog
# Exit SERVICE_USER shell # Exit SERVICE_USER shell
exit exit
``` ```