build: retry PPA upload up to three times (#31099)
This commit is contained in:
parent
d80da7c3b4
commit
7d0e197def
12
build/ci.go
12
build/ci.go
|
@ -883,11 +883,17 @@ func ppaUpload(workdir, ppa, sshUser string, files []string) {
|
||||||
os.WriteFile(idfile, sshkey, 0600)
|
os.WriteFile(idfile, sshkey, 0600)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Upload
|
// Upload. This doesn't always work, so try up to three times.
|
||||||
dest := sshUser + "@ppa.launchpad.net"
|
dest := sshUser + "@ppa.launchpad.net"
|
||||||
if err := build.UploadSFTP(idfile, dest, incomingDir, files); err != nil {
|
for i := 0; i < 3; i++ {
|
||||||
log.Fatal(err)
|
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 {
|
func getenvBase64(variable string) []byte {
|
||||||
|
|
Loading…
Reference in New Issue