build/ci: handle split up listing (#21293)

This commit is contained in:
Martin Holst Swende
2020-07-04 20:10:48 +02:00
committed by GitHub
parent 490b380a04
commit fa01117498
2 changed files with 23 additions and 10 deletions

View File

@ -1098,6 +1098,8 @@ func doPurge(cmdline []string) {
if err != nil {
log.Fatal(err)
}
fmt.Printf("Found %d blobs\n", len(blobs))
// Iterate over the blobs, collect and sort all unstable builds
for i := 0; i < len(blobs); i++ {
if !strings.Contains(blobs[i].Name, "unstable") {
@ -1119,6 +1121,7 @@ func doPurge(cmdline []string) {
break
}
}
fmt.Printf("Deleting %d blobs\n", len(blobs))
// Delete all marked as such and return
if err := build.AzureBlobstoreDelete(auth, blobs); err != nil {
log.Fatal(err)