dpl 1.8.26.travis.1775.3 → 1.8.26.travis.1776.3

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
  SHA1:
3
- metadata.gz: 442f26b778bea17923fc71d68890ca09edd01fa5
4
- data.tar.gz: c123a7b359513699f94335e1b25fb37ce87d1f04
3
+ metadata.gz: 9465c1dab155c9ccf06b79e582b51d726248a1c3
4
+ data.tar.gz: 6a169b68a6b3508d914772db0b4df5b4d5bf1bb5
5
5
  SHA512:
6
- metadata.gz: e9bfb2f9e1c71fc5cfd6ab0b2e5908b442b21f6cb09621920d44e8dd33e52a5990665482e9ee2b9ef4269dedd96e52a3a4d5a8f5e0413e1283489c94a7885a4a
7
- data.tar.gz: 9a5acc56187d8c68e17063ce3ef4a60207f7077ffe2e0358f254591a9e2ccdf0728311f471698c60d71a79e21ec907f8bac15e0eb010f664c7eee7f95b8abc22
6
+ metadata.gz: baaf228c06ec012f2d7949c32224e2d613ffe9bf06e2bd220a4ed9e20fe49586e0a3d7e78a328c7ed7dd8bd468eaf9ecc8f7f02c21920414e01a82a1f51dc736
7
+ data.tar.gz: eaf9163f3c9a5914702e73d970153abb6184ae50b6df15663c87d3362df64f3c66b04a7e4bf728531c81350344c66e17c62d7acb0b4a58a30933a9905f770d26
data/README.md CHANGED
@@ -319,6 +319,7 @@ For authentication you can also use Travis CI secure environment variable:
319
319
  * **region**: S3 Region. Defaults to us-east-1.
320
320
  * **upload-dir**: S3 directory to upload to. Defaults to root directory.
321
321
  * **storage-class**: S3 storage class to upload as. Defaults to "STANDARD". Other values are "STANDARD_IA" or "REDUCED_REDUNDANCY". Details can be found [here](https://aws.amazon.com/s3/storage-classes/).
322
+ * **server-side-encryption**: When set to `true`, use S3 Server Side Encryption (SSE-AES256). Defaults to non-encrypted.
322
323
  * **local-dir**: Local directory to upload from. Can be set from a global perspective (~/travis/build) or relative perspective (build) Defaults to project root.
323
324
  * **detect-encoding**: Set HTTP header `Content-Encoding` for files compressed with `gzip` and `compress` utilities. Defaults to not set.
324
325
  * **cache_control**: Set HTTP header `Cache-Control` to suggest that the browser cache the file. Defaults to `no-cache`. Valid options are `no-cache`, `no-store`, `max-age=<seconds>`,`s-maxage=<seconds>` `no-transform`, `public`, `private`.
@@ -46,11 +46,12 @@ module DPL
46
46
  glob_args << File::FNM_DOTMATCH if options[:dot_match]
47
47
  Dir.chdir(options.fetch(:local_dir, Dir.pwd)) do
48
48
  Dir.glob(*glob_args) do |filename|
49
- opts = content_data_for(filename)
50
- opts[:cache_control] = get_option_value_by_filename(options[:cache_control], filename) if options[:cache_control]
51
- opts[:acl] = options[:acl].gsub(/_/, '-') if options[:acl]
52
- opts[:expires] = get_option_value_by_filename(options[:expires], filename) if options[:expires]
53
- opts[:storage_class] = options[:storage_class] if options[:storage_class]
49
+ opts = content_data_for(filename)
50
+ opts[:cache_control] = get_option_value_by_filename(options[:cache_control], filename) if options[:cache_control]
51
+ opts[:acl] = options[:acl].gsub(/_/, '-') if options[:acl]
52
+ opts[:expires] = get_option_value_by_filename(options[:expires], filename) if options[:expires]
53
+ opts[:storage_class] = options[:storage_class] if options[:storage_class]
54
+ opts[:server_side_encryption] = "AES256" if options[:server_side_encryption]
54
55
  unless File.directory?(filename)
55
56
  log "uploading #{filename.inspect} with #{opts.inspect}"
56
57
  result = api.bucket(option(:bucket)).object(upload_path(filename)).upload_file(filename, opts)
@@ -134,6 +134,13 @@ describe DPL::Provider::S3 do
134
134
  provider.push_app
135
135
  end
136
136
 
137
+ example "Sets SSE" do
138
+ provider.options.update(:server_side_encryption => true)
139
+ expect(Dir).to receive(:glob).and_yield(__FILE__)
140
+ expect_any_instance_of(Aws::S3::Object).to receive(:upload_file).with(anything(), hash_including(:server_side_encryption => "AES256"))
141
+ provider.push_app
142
+ end
143
+
137
144
  example "Sets Website Index Document" do
138
145
  provider.options.update(:index_document_suffix => "test/index.html")
139
146
  expect(Dir).to receive(:glob).and_yield(__FILE__)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.26.travis.1775.3
4
+ version: 1.8.26.travis.1776.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase