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: 7722c37f99dfb77c35ecc2d813ab65430855d30fa84ebb8836b48e8819e32c56
4
- data.tar.gz: 2f992f399433095c273d05b41b15a76958730aeb574b025f1ab804ea993eb290
3
+ metadata.gz: b2b10c9286500f94660d0583cc9aeaa2a1ba2ffc0bbddf76d2f210709e36ffcd
4
+ data.tar.gz: 9ab116dd4d4f2d0698adcbf80b2f4c5cf0b339435b965121c8cca1aa4d081d1c
5
5
  SHA512:
6
- metadata.gz: 1c5b08dba58c1d367c6481d21481ebe62044fbec30765d0d0a0ab2f270d7b241e070b4cbb2c6d6773c08888e313b690089a4ff2faa928a4a9f68d5befed8d5c5
7
- data.tar.gz: c0cab48cf344df067e70660ec347ca8c11e2b4d7d2517b4364434c576355653067ef3d8a2e8db334d4b1d028b4d1b4ecd338512aad0c72474ed51cb80ba6d83c
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 s3
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) { |obj| bucket.create_file(obj[:file], obj[:path]) }
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Publisher
4
- VERSION = "0.10.0"
4
+ VERSION = "0.11.0"
5
5
  end
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.10.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-08-13 00:00:00.000000000 Z
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.45.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.45.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