Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 7ddb2ee

Browse files
chris-cronendeloof
authored andcommitted
CI: Only clean images if there are any
Signed-off-by: Christopher Crone <[email protected]>
1 parent 0803a77 commit 7ddb2ee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pipeline {
5757
archiveArtifacts 'bin/*.tar.gz'
5858
}
5959
} finally {
60-
def clean_images = /docker image ls --format="{{.Repository}}:{{.Tag}}" '*$BUILD_TAG*' | xargs docker image rm -f/
60+
def clean_images = /docker image ls --format="{{.Repository}}:{{.Tag}}" '*$BUILD_TAG*' | xargs --no-run-if-empty docker image rm -f/
6161
sh clean_images
6262
}
6363
}

Jenkinsfile.baguette

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pipeline {
4545
}
4646
archiveArtifacts 'bin/*.tar.gz'
4747
} finally {
48-
def clean_images = /docker image ls --format="{{.Repository}}:{{.Tag}}" '*$TAG*' | xargs docker image rm -f/
48+
def clean_images = /docker image ls --format="{{.Repository}}:{{.Tag}}" '*$TAG*' | xargs --no-run-if-empty docker image rm -f/
4949
sh clean_images
5050
}
5151
}

0 commit comments

Comments
 (0)