From 07addf74fd42bd770bc4b1d6315d1f5fe1a3e37d Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 24 Oct 2018 12:21:07 +0100 Subject: [PATCH] fstest/test_all: upload a copy of the report to "current" --- fstest/test_all/report.go | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/fstest/test_all/report.go b/fstest/test_all/report.go index a647239a2..ddc2167c1 100644 --- a/fstest/test_all/report.go +++ b/fstest/test_all/report.go @@ -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") +}