Clean up CI images
node('gcp-linux-worker-0') {
stage('Build') {
dir('src/github.com/docker/lunchbox') {
+ try {
checkout scm
sh 'rm -f *.tar.gz'
sh 'docker image prune -f'
@@ -10,6 +11,10 @@ node('gcp-linux-worker-0') {
sh 'make ci-bin-darwin'
sh 'make ci-bin-windows'
archiveArtifacts '*.tar.gz'
+ } finally {
+ def clean_images = /docker image ls --format "{{.ID}}\t{{.Tag}}" | grep $(git describe --always --dirty) | awk '{print $1}' | xargs docker image rm/
+ sh clean_images
+ }
}
}
}
