Skip to content

Commit 697e449

Browse files
add upload entry purge
1 parent 7c50766 commit 697e449

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pkg/buildtest/run.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,29 @@ func prepareMigrateEntriesByFolo(targetIndyURL, migrateTargetIndyHost, packageTy
257257
newBuildId string, foloRecord common.TrackedContent) map[string][]string {
258258
targetIndy := normIndyURL(targetIndyURL)
259259
result := make(map[string][]string)
260+
for _, up := range foloRecord.Uploads {
261+
broken := false
262+
migratePath := setHostname(up.LocalUrl, migrateTargetIndyHost)
263+
fmt.Printf("[%s] Deleting %s\n", time.Now().Format(DATA_TIME), migratePath)
264+
broken = !delArtifact(migratePath)
265+
266+
if strings.HasPrefix(up.StoreKey, "maven:hosted:build-") {
267+
migratePath, _ = url.JoinPath("http://"+migrateTargetIndyHost, "/api/content", packageType, "/hosted/pnc-builds", up.Path)
268+
fmt.Printf("[%s] Deleting %s\n", time.Now().Format(DATA_TIME), migratePath)
269+
broken = !delArtifact(migratePath)
270+
migratePath, _ = url.JoinPath("http://"+migrateTargetIndyHost, "/api/content", packageType, "/remote/mrrc-ga-rh", up.Path)
271+
fmt.Printf("[%s] Deleting %s\n", time.Now().Format(DATA_TIME), migratePath)
272+
broken = !delArtifact(migratePath)
273+
}
274+
275+
if broken {
276+
fmt.Printf("[%s] Deletion failed for %s\n", time.Now().Format(DATA_TIME), migratePath)
277+
}
278+
}
279+
280+
fmt.Printf("Waiting 30s...\n")
281+
time.Sleep(30 * time.Second) // wait for Indy event handled
282+
260283
for _, down := range foloRecord.Downloads {
261284
var p string
262285
downUrl := ""

0 commit comments

Comments
 (0)