mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 10:13:52 +08:00
fstest/test_all: upload a copy of the report to "current"
This commit is contained in:
parent
52c7c738ca
commit
07addf74fd
|
@ -242,14 +242,11 @@ func (r *Report) EmailHTML() {
|
|||
_ = in.Close()
|
||||
}
|
||||
|
||||
// Upload uploads a copy of the report online
|
||||
func (r *Report) Upload() {
|
||||
if *uploadPath == "" || r.IndexHTML == "" {
|
||||
return
|
||||
}
|
||||
dst := path.Join(*uploadPath, r.DateTime)
|
||||
// uploadTo uploads a copy of the report online to the dir given
|
||||
func (r *Report) uploadTo(uploadDir string) {
|
||||
dst := path.Join(*uploadPath, uploadDir)
|
||||
log.Printf("Uploading results to %q", dst)
|
||||
cmdLine := []string{"rclone", "copy", "-v", r.LogDir, dst}
|
||||
cmdLine := []string{"rclone", "sync", "--stats-log-level", "NOTICE", r.LogDir, dst}
|
||||
cmd := exec.Command(cmdLine[0], cmdLine[1:]...)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
|
@ -258,3 +255,14 @@ func (r *Report) Upload() {
|
|||
log.Fatalf("Failed to upload results: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Upload uploads a copy of the report online
|
||||
func (r *Report) Upload() {
|
||||
if *uploadPath == "" || r.IndexHTML == "" {
|
||||
return
|
||||
}
|
||||
// Upload into dated directory
|
||||
r.uploadTo(r.DateTime)
|
||||
// And again into current
|
||||
r.uploadTo("current")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user