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

Commit 07cd72d

Browse files
committed
Clean up CI images
Signed-off-by: Christopher Crone <[email protected]>
1 parent 3d3298d commit 07cd72d

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

Jenkinsfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
node('gcp-linux-worker-0') {
22
stage('Build') {
33
dir('src/github.com/docker/lunchbox') {
4-
checkout scm
5-
sh 'rm -f *.tar.gz'
6-
sh 'docker image prune -f'
7-
sh 'make ci-lint'
8-
sh 'make ci-test'
9-
sh 'make ci-bin-linux'
10-
sh 'make ci-bin-darwin'
11-
sh 'make ci-bin-windows'
12-
archiveArtifacts '*.tar.gz'
4+
try {
5+
checkout scm
6+
sh 'rm -f *.tar.gz'
7+
sh 'docker image prune -f'
8+
sh 'make ci-lint'
9+
sh 'make ci-test'
10+
sh 'make ci-bin-linux'
11+
sh 'make ci-bin-darwin'
12+
sh 'make ci-bin-windows'
13+
archiveArtifacts '*.tar.gz'
14+
} finally {
15+
def clean_images = /docker image ls --format "{{.ID}}\t{{.Tag}}" | grep $(git describe --always --dirty) | awk '{print $1}' | xargs docker image rm/
16+
sh clean_images
17+
}
1318
}
1419
}
1520
}

0 commit comments

Comments
 (0)