Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
shokakucarrier committed Mar 12, 2024
1 parent d29ebdd commit 3aa8d27
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions pkg/buildtest/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,26 +108,26 @@ func DoRun(originalIndy, targetIndy, indyProxyUrl, migrateTargetIndy, packageTyp
paths := []string{}
rhpaths := []string{}
for i, down := range downloads {
if strings.Contains(down[3],"/maven/remote/") || strings.Contains(down[3],"/npm/remote/"){
if strings.Contains(down[3], "/maven/remote/") || strings.Contains(down[3], "/npm/remote/") {
continue
}
deletePath := setHostname(down[3],migrateTargetIndyHost)
deletePath := setHostname(down[3], migrateTargetIndyHost)
fmt.Printf("[%s] Deleting %s\n", time.Now().Format(DATA_TIME), deletePath)
broken = !delRequest(deletePath)
broken = !migrateFunc(down[0], down[1], down[2], setHostname(down[2],migrateTargetIndyHost))
broken = !migrateFunc(down[0], down[1], down[2], setHostname(down[2], migrateTargetIndyHost))
if broken {
break
} else {
if strings.Contains(i, "redhat"){
if strings.Contains(i, "redhat") {
rhpaths = append(rhpaths, i)
} else {
paths = append(paths, i)
}
}
}
targetStore := packageType+":hosted:shared-imports"
rhTargetStore := packageType+":hosted:pnc-builds"
sourceStore := packageType+":hosted:"+newBuildName
targetStore := packageType + ":hosted:shared-imports"
rhTargetStore := packageType + ":hosted:pnc-builds"
sourceStore := packageType + ":hosted:" + newBuildName
promotetest.MigratePromote("http://"+migrateTargetIndyHost, newBuildName, sourceStore, targetStore, paths, false)
if len(rhpaths) > 0 {
fmt.Printf("Waiting 180s...\n")
Expand Down Expand Up @@ -339,10 +339,10 @@ func prepareDownUploadDirectories(buildId string, clearCache bool) (string, stri
}

func setHostname(addr, hostname string) string {
u, err := url.Parse(addr)
if err != nil {
return ""
}
u.Host = hostname
return u.String()
u, err := url.Parse(addr)
if err != nil {
return ""
}
u.Host = hostname
return u.String()
}
2 changes: 1 addition & 1 deletion pkg/promotetest/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ func DoRun(indyBaseUrl, foloTrackId, sourceStore, targetStore, newVersionNum str

func MigratePromote(indyURL, trackingId, source, target string, paths []string, dryRun bool) (string, int, bool) {
return promote(indyURL, trackingId, source, target, paths, dryRun)
}
}

0 comments on commit 3aa8d27

Please sign in to comment.