dpl 1.6.5.travis.466.1 → 1.6.5.travis.468.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +4 -2
- data/lib/dpl/provider/s3.rb +2 -0
- data/spec/provider/s3_spec.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjY2ZjcwMGE3MWYyMDFkMzYxMjdkMGM4OTgyYTZlMGQzNmE3MmIzMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODM2N2IwNjhjYTM0NDY1YTFkYjY1NTZjOWY0Y2FiYjM4ZDA2ZTJiMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDY2NWI4NzRjYTBhZjBkMGMyMDdmMDU1NGYzMWRjZDcyMjRjYmY2YjU0MDhl
|
10
|
+
YmVhZGY0YjQyMjFkMjg0YWEyMmRkNGJjZTg1MWI2NDk1NzEwNmU0ZTFkYWZl
|
11
|
+
NjQ5MzlmNDE5MjgxYWVjOGY0NTg0NDk1N2VkMDY1ZWEwMmM3NTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODA4ZGZjNDAwNDEzYzMyMjAxNTdmZmUyMjU0YzNjOTZlMDc3ZDc1ODQxN2Uy
|
14
|
+
NDE1MjNiYzYzYWZmMGI0NDFmMDIwZGQ3ZjE2ZTgzYmY3ZDYyMGNkMGJlOTU1
|
15
|
+
MDE0OThjNDI5ZGU1ZWMyYmIwZWQ0NzU4YTE1MzRmMmNlMmVhODU=
|
data/README.md
CHANGED
@@ -181,12 +181,14 @@ As a rule of thumb, you should switch to the Git strategy if you run into issues
|
|
181
181
|
* **endpoint**: S3 Endpoint. Defaults to s3.amazonaws.com.
|
182
182
|
* **upload-dir**: S3 directory to upload to. Defaults to root directory.
|
183
183
|
* **local-dir**: Local directory to upload from. Can be set from a global perspective (~/travis/build) or relative perspective (build) Defaults to project root.
|
184
|
-
* **detect-encoding**: Set HTTP header `Content-Encoding` for files compressed with `gzip` and `compress` utilities.
|
184
|
+
* **detect-encoding**: Set HTTP header `Content-Encoding` for files compressed with `gzip` and `compress` utilities. Defaults to not set.
|
185
|
+
* **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`.
|
186
|
+
* **expires**: This sets the date and time that the cached object is no longer cacheable. Defaults to not set. The date must be in the format `YYYY-MM-DD HH:MM:SS -ZONE`.
|
185
187
|
|
186
188
|
#### Examples:
|
187
189
|
|
188
190
|
dpl --provider=s3 --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket>
|
189
|
-
dpl --provider=s3 --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket> --detect-encoding
|
191
|
+
dpl --provider=s3 --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket> --detect-encoding --cache_control=max-age=99999 --expires="2012-12-21 00:00:00 -0000"
|
190
192
|
dpl --provider=s3 --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket> --region:us-west-2 --local-dir= BUILD --upload-dir=BUILDS
|
191
193
|
|
192
194
|
### OpsWorks:
|
data/lib/dpl/provider/s3.rb
CHANGED
@@ -36,6 +36,8 @@ module DPL
|
|
36
36
|
Dir.glob("**/*") do |filename|
|
37
37
|
content_type = MIME::Types.type_for(filename).first.to_s
|
38
38
|
opts = { :content_type => content_type }.merge(encoding_option_for(filename))
|
39
|
+
opts[:cache_control] = options[:cache_control] if options[:cache_control]
|
40
|
+
opts[:expires] = options[:expires] if options[:expires]
|
39
41
|
unless File.directory?(filename)
|
40
42
|
api.buckets[option(:bucket)].objects.create(upload_path(filename), File.read(filename), opts)
|
41
43
|
end
|
data/spec/provider/s3_spec.rb
CHANGED
@@ -73,6 +73,13 @@ describe DPL::Provider::S3 do
|
|
73
73
|
provider.push_app
|
74
74
|
end
|
75
75
|
|
76
|
+
example "Sets Cache and Expiration" do
|
77
|
+
provider.options.update(:cache_control => "max-age=99999999", :expires => "2012-12-21 00:00:00 -0000")
|
78
|
+
expect(Dir).to receive(:glob).and_yield(__FILE__)
|
79
|
+
expect_any_instance_of(AWS::S3::ObjectCollection).to receive(:create).with(anything(), anything(), hash_including(:cache_control => 'max-age=99999999', :expires => '2012-12-21 00:00:00 -0000'))
|
80
|
+
provider.push_app
|
81
|
+
end
|
82
|
+
|
76
83
|
example "when detect_encoding is set" do
|
77
84
|
path = 'foo.js'
|
78
85
|
provider.options.update(:detect_encoding => true)
|