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 +4 -4
- data/README.md +1 -0
- data/lib/dpl/provider/s3.rb +6 -5
- data/spec/provider/s3_spec.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9465c1dab155c9ccf06b79e582b51d726248a1c3
|
4
|
+
data.tar.gz: 6a169b68a6b3508d914772db0b4df5b4d5bf1bb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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`.
|
data/lib/dpl/provider/s3.rb
CHANGED
@@ -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
|
50
|
-
opts[:cache_control]
|
51
|
-
opts[:acl]
|
52
|
-
opts[:expires]
|
53
|
-
opts[: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)
|
data/spec/provider/s3_spec.rb
CHANGED
@@ -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__)
|