allure-report-publisher 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2b10c9286500f94660d0583cc9aeaa2a1ba2ffc0bbddf76d2f210709e36ffcd
|
4
|
+
data.tar.gz: 9ab116dd4d4f2d0698adcbf80b2f4c5cf0b339435b965121c8cca1aa4d081d1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d0206593844b02dc18b72f8e835e71ea0b6864c647ce4a9c7dc249c58ab6d16129fe3cbd31b8dd6e3c3e596693f1947cee1643ff70d48b14fdb5434cdcb62d3
|
7
|
+
data.tar.gz: ea0c81164c7a93d9451e9325ec1c6a14b220d7305814bbfbfbece77cb59a9c14635343ae11d92f7b1cc3b035e470eb929ab2e982002199aafb399c189c2427c8
|
@@ -65,23 +65,27 @@ module Publisher
|
|
65
65
|
#
|
66
66
|
# @return [void]
|
67
67
|
def upload_latest_copy
|
68
|
-
upload_to_gcs(report_files, prefix)
|
68
|
+
upload_to_gcs(report_files, prefix, cache_control: 60)
|
69
69
|
end
|
70
70
|
|
71
|
-
# Upload files to
|
71
|
+
# Upload files to gcs
|
72
72
|
#
|
73
73
|
# @param [Array<Pathname>] files
|
74
74
|
# @param [String] key_prefix
|
75
|
+
# @param [Hash] params
|
75
76
|
# @return [Array<Hash>]
|
76
|
-
def upload_to_gcs(files, key_prefix)
|
77
|
+
def upload_to_gcs(files, key_prefix, cache_control: 3600)
|
77
78
|
args = files.map do |file|
|
78
79
|
{
|
79
80
|
file: file.to_s,
|
80
|
-
path: key(key_prefix, file.relative_path_from(report_path))
|
81
|
+
path: key(key_prefix, file.relative_path_from(report_path)),
|
82
|
+
cache_control: "public, max-age=#{cache_control}"
|
81
83
|
}
|
82
84
|
end
|
83
85
|
|
84
|
-
Parallel.each(args, in_threads: 8)
|
86
|
+
Parallel.each(args, in_threads: 8) do |obj|
|
87
|
+
bucket.create_file(*obj.slice(:file, :path).values, **obj.slice(:cache_control))
|
88
|
+
end
|
85
89
|
end
|
86
90
|
|
87
91
|
# Fabricate key for s3 object
|
@@ -76,7 +76,7 @@ module Publisher
|
|
76
76
|
#
|
77
77
|
# @return [void]
|
78
78
|
def upload_latest_copy
|
79
|
-
upload_to_s3(report_files, prefix)
|
79
|
+
upload_to_s3(report_files, prefix, cache_control: 60)
|
80
80
|
end
|
81
81
|
|
82
82
|
# Upload files to s3
|
@@ -84,13 +84,14 @@ module Publisher
|
|
84
84
|
# @param [Array<Pathname>] files
|
85
85
|
# @param [String] key_prefix
|
86
86
|
# @return [Array<Hash>]
|
87
|
-
def upload_to_s3(files, key_prefix)
|
87
|
+
def upload_to_s3(files, key_prefix, cache_control: 3600)
|
88
88
|
args = files.map do |file|
|
89
89
|
{
|
90
90
|
body: File.new(file),
|
91
91
|
bucket: bucket_name,
|
92
92
|
key: key(key_prefix, file.relative_path_from(report_path)),
|
93
|
-
content_type: MiniMime.lookup_by_filename(file).content_type
|
93
|
+
content_type: MiniMime.lookup_by_filename(file).content_type,
|
94
|
+
cache_control: "max-age=#{cache_control}"
|
94
95
|
}
|
95
96
|
end
|
96
97
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allure-report-publisher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrejs Cunskis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -362,14 +362,14 @@ dependencies:
|
|
362
362
|
requirements:
|
363
363
|
- - "~>"
|
364
364
|
- !ruby/object:Gem::Version
|
365
|
-
version: 0.
|
365
|
+
version: 0.46.0
|
366
366
|
type: :development
|
367
367
|
prerelease: false
|
368
368
|
version_requirements: !ruby/object:Gem::Requirement
|
369
369
|
requirements:
|
370
370
|
- - "~>"
|
371
371
|
- !ruby/object:Gem::Version
|
372
|
-
version: 0.
|
372
|
+
version: 0.46.0
|
373
373
|
description: Upload allure reports to different file storage providers
|
374
374
|
email:
|
375
375
|
- andrejs.cunskis@gmail.com
|