From 06faa992673f5277ff173079fbd8e3a48610a9c2 Mon Sep 17 00:00:00 2001 From: shindw Date: Wed, 4 Feb 2026 16:06:01 +0900 Subject: [PATCH] =?UTF-8?q?[api]=20Jenkinsfile.pjt=20-=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=EC=A0=95=EC=B1=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile.pjt | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/Jenkinsfile.pjt b/Jenkinsfile.pjt index 8ad3f9b..a391414 100644 --- a/Jenkinsfile.pjt +++ b/Jenkinsfile.pjt @@ -217,37 +217,6 @@ pipeline { echo "[0] Repo: $REPO" - echo "[1] Collect running image refs (repo:tag) to protect" - RUNNING_REFS=$(docker ps --format "{{.Image}}" | grep -E "^${REPO}:" | sort -u || true) - - if [ -n "$RUNNING_REFS" ]; then - echo "Running refs (protected):" - echo "$RUNNING_REFS" | sed "s/^/ - /" - else - echo "No running refs found for $REPO (check if you run by digest or different name)" - fi - - echo "[2] Remove stopped containers (so they dont hold images)" - docker container prune -f - - echo "[3] List all local refs for repo" - ALL_REFS=$(docker images "$REPO" --format "{{.Repository}}:{{.Tag}}" | grep -v "" | sort -u || true) - - echo "[4] Remove repo images except protected running refs" - for REF in $ALL_REFS; do - if [ -n "$RUNNING_REFS" ] && echo "$RUNNING_REFS" | grep -qx "$REF"; then - echo "Skip running: $REF" - continue - fi - echo "Removing: $REF" - docker rmi -f "$REF" || true - done - - echo "[5] Remove dangling images" - docker image prune -f - - echo "[6] Remove unused volumes" - docker volume prune -f ' ''' }