Skip to content

Commit

Permalink
build: retry PPA upload up to three times (#31099)
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed Jan 30, 2025
1 parent 293a300 commit db93d49
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -888,11 +888,17 @@ func ppaUpload(workdir, ppa, sshUser string, files []string) {
os.WriteFile(idfile, sshkey, 0600)
}
}
// Upload
// Upload. This doesn't always work, so try up to three times.
dest := sshUser + "@ppa.launchpad.net"
if err := build.UploadSFTP(idfile, dest, incomingDir, files); err != nil {
log.Fatal(err)
for i := 0; i < 3; i++ {
err := build.UploadSFTP(idfile, dest, incomingDir, files)
if err == nil {
return
}
log.Println("PPA upload failed:", err)
time.Sleep(5 * time.Second)
}
log.Fatal("PPA upload failed all attempts.")
}

func getenvBase64(variable string) []byte {
Expand Down

0 comments on commit db93d49

Please sign in to comment.