Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #596 from vania-pooh/master
Browse files Browse the repository at this point in the history
Added $date placeholder support to S3 (fixes #595)
  • Loading branch information
aandryashin authored Nov 1, 2018
2 parents 35e6e21 + 24a84d6 commit 35a81cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/s3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ By default uploaded file name is preserved, i.e. S3 path is `/<session-id>.log`

| $browserName | Replaced by Selenium browser name capability value
| $browserVersion | Replaced by Selenium browser version capability value
| $date | Replaced by current date, e.g. `2018-11-01`
| $fileName | Replaced by source file name
| $fileExtension | Replaced by source file extension
| $fileType | Replaced by `log` for log files and `video` for video files
Expand Down
2 changes: 2 additions & 0 deletions upload/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"os"
"path/filepath"
"strings"
"time"
)

func init() {
Expand Down Expand Up @@ -104,6 +105,7 @@ func GetS3Key(keyPattern string, input *UploadRequest) string {
key = strings.Replace(key, "$quota", strings.ToLower(sess.Quota), -1)
key = strings.Replace(key, "$sessionId", strings.ToLower(input.SessionId), -1)
key = strings.Replace(key, "$fileType", strings.ToLower(input.Type), -1)
key = strings.Replace(key, "$date", time.Now().Format("2006-01-02"), -1)
key = strings.Replace(key, " ", "-", -1)
return key
}

0 comments on commit 35a81cf

Please sign in to comment.