[api] Jenkinsfile.pjt
- 레파지토리 이미지 목록 조회
This commit is contained in:
+5
-1
@@ -239,7 +239,11 @@ pipeline {
|
|||||||
|
|
||||||
TAGS_TO_DELETE=$(curl -s -u "$DOCKER_USER:$DOCKER_PASS" https://${REGISTRY_HOST}/v2/${IMAGE_REPO}/tags/list | jq -r '.tags[]' | grep -E '^[0-9]+' | sort -t- -k1,1n | head -n -5)
|
TAGS_TO_DELETE=$(curl -s -u "$DOCKER_USER:$DOCKER_PASS" https://${REGISTRY_HOST}/v2/${IMAGE_REPO}/tags/list | jq -r '.tags[]' | grep -E '^[0-9]+' | sort -t- -k1,1n | head -n -5)
|
||||||
|
|
||||||
echo "$TAGS_TO_DELETE"
|
for TAG in $TAGS_TO_DELETE; do
|
||||||
|
DIGEST=$(curl -sI -u "$DOCKER_USER:$DOCKER_PASS" -H "Accept: application/vnd.docker.distribution.manifest.v2+json" https://${REGISTRY_HOST}/v2/${IMAGE_REPO}/manifests/$TAG | grep Docker-Content-Digest | awk '{print $2}' | tr -d $'\r')
|
||||||
|
|
||||||
|
echo "[DRY] $TAG -> $DIGEST"
|
||||||
|
done
|
||||||
|
|
||||||
docker logout ${REGISTRY_HOST}
|
docker logout ${REGISTRY_HOST}
|
||||||
'''
|
'''
|
||||||
|
|||||||
Reference in New Issue
Block a user