Fixed images cleanup in build pipeline
Change-Id: I260b78b5958b558e60a8d6594b9292d340c5439b
diff --git a/Jenkinsfile b/Jenkinsfile
index ec46015..954ecac 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -217,7 +217,11 @@
def remoteImagesSameType = remoteImages.findAll { it ->
it =~ /${imageTypeForRegex}$/
}
- return remoteImagesSameType.toSorted().findAll { it ->
+ def imagesToClean = remoteImagesSameType.toSorted().findAll { it ->
it =~ /^${osImageForRegex}-/
}
+ // dont cleanup non timestamp images
+ return imageToClean.findAll { it ->
+ it =~ /${osImageForRegex}-x(64|32)-\d+${imageTypeForRegex}/
+ }
}