Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 2.01 KB

s3.adoc

File metadata and controls

38 lines (26 loc) · 2.01 KB

Uploading Files To S3

Important

This feature only becomes available when Selenoid is compiled with s3 build tag (missing by default) as follows:

$ go build -tags s3

Selenoid can upload recorded video and log files for every running session to S3-compatible storage.

To enable this feature you need to specify S3 access information as follows:

$ ./selenoid -s3-endpoint https://s3.us-east-2.amazonaws.com -s3-region us-east-2 -s3-bucket-name my-bucket -s3-access-key <your-access-key> -s3-secret-key <your-secret-key>
Note
If you omit -s3-access-key and -s3-secret-key flags then environment variables and shared credentials file are automatically tried as a fallback.

By default uploaded file name is preserved, i.e. S3 path is /<session-id>.log or /myCustomVideo.mp4. You can optionally provide your custom key pattern using -s3-key-pattern flag and a set of placeholders:

Table 1. S3 Key Placeholders
Placeholder Meaning

$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

$platformName

Replaced by Selenium platform capability value

$quota

Replaced by quota name (usually coming from Ggr)

$sessionId

Replaced by Selenium session ID

For example, when launching Selenoid with -s3-key-pattern $browserName/$sessionId/log.txt files will be accessible as firefox/0ee0b48b-e29b-6749-b4f1-2277b8f8d6c5/log.txt. You can also override key pattern for every session with s3KeyPattern capability.

Sometimes you may want to upload only video files or files matching some complicated pattern or to not upload some files. To achieve this use -s3-include-files and -s3-exclude-files flags. These flags accept globs such as *.mp4.