[api] Jenkinsfile.pjt
- 레파지토리 이미지 삭제
This commit is contained in:
@@ -240,7 +240,14 @@ pipeline {
|
|||||||
for TAG in $TAGS_TO_DELETE; do
|
for TAG in $TAGS_TO_DELETE; do
|
||||||
DIGEST=$(curl -s -u "$DOCKER_USER:$DOCKER_PASS" -H "Accept: application/vnd.oci.image.index.v1+json, application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v2+json" -D - https://${REGISTRY_HOST}/v2/${IMAGE_REPO}/manifests/$TAG -o /dev/null | grep -i Docker-Content-Digest | awk '{print $2}' | tr -d $'\r')
|
DIGEST=$(curl -s -u "$DOCKER_USER:$DOCKER_PASS" -H "Accept: application/vnd.oci.image.index.v1+json, application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v2+json" -D - https://${REGISTRY_HOST}/v2/${IMAGE_REPO}/manifests/$TAG -o /dev/null | grep -i Docker-Content-Digest | awk '{print $2}' | tr -d $'\r')
|
||||||
|
|
||||||
|
if [ -z "$DIGEST" ]; then
|
||||||
|
echo "[SKIP] $TAG digest not found"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[DRY] $TAG -> $DIGEST"
|
echo "[DRY] $TAG -> $DIGEST"
|
||||||
|
|
||||||
|
curl -s -u "$DOCKER_USER:$DOCKER_PASS" -X DELETE "https://${REGISTRY_HOST}/v2/${IMAGE_REPO}/manifests/${DIGEST}" -o /dev/null -w "HTTP %{http_code}\n"
|
||||||
done
|
done
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|||||||
Reference in New Issue
Block a user