capistrano-s3 2.3.0 → 3.0.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/build.yml +20 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +59 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +15 -2
- data/Guardfile +18 -0
- data/README.md +52 -3
- data/Rakefile +7 -5
- data/capistrano-s3.gemspec +31 -27
- data/certs/aleksandrs-ledovskis--2025-07-03-2035-07-01.pem +26 -0
- data/lib/capistrano/s3/defaults.rb +11 -9
- data/lib/capistrano/s3/mime_types.rb +55 -0
- data/lib/capistrano/s3/publisher.rb +122 -101
- data/lib/capistrano/s3/version.rb +3 -1
- data/lib/capistrano/s3.rb +6 -3
- data/lib/capistrano/tasks/capistrano_2.rb +18 -5
- data/lib/capistrano/tasks/capistrano_3.rb +22 -5
- data/spec/capistrano/s3/publisher_spec.rb +214 -0
- data/spec/sample-mime/script.js +1 -0
- data/spec/sample-write/assets/script.js +1 -0
- data/spec/sample-write/assets/style.css +3 -0
- data/spec/sample-write/index.html +4 -0
- data/spec/spec_helper.rb +8 -2
- data.tar.gz.sig +0 -0
- metadata +46 -108
- metadata.gz.sig +4 -3
- data/.travis.yml +0 -21
- data/certs/aleksandrs-ledovskis--2018-11-04-2020-11-03.pem +0 -26
- data/certs/j15e.pem +0 -22
- data/spec/publisher_spec.rb +0 -75
@@ -0,0 +1,214 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
describe Capistrano::S3::Publisher do
|
6
|
+
before do
|
7
|
+
@root = File.expand_path(__dir__)
|
8
|
+
publish_file = Capistrano::S3::Publisher::LAST_PUBLISHED_FILE
|
9
|
+
FileUtils.rm(publish_file) if File.exist?(publish_file)
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "::files" do
|
13
|
+
# @todo don't test via private methods
|
14
|
+
subject(:files) { described_class.send(:files, deployment_path, exclusions) }
|
15
|
+
|
16
|
+
let(:deployment_path) { "spec/sample-2" }
|
17
|
+
let(:exclusions) { [] }
|
18
|
+
|
19
|
+
it "includes dot-prefixed/hidden directories" do
|
20
|
+
expect(files).to include("spec/sample-2/.well-known/test.txt")
|
21
|
+
end
|
22
|
+
|
23
|
+
it "includes dot-prefixed/hidden files" do
|
24
|
+
expect(files).to include("spec/sample-2/public/.htaccess")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "publish!" do
|
29
|
+
it "publish all files" do
|
30
|
+
Aws::S3::Client.any_instance.expects(:put_object).times(8)
|
31
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
32
|
+
"spec/sample", "", "cf123", [], [], false, {}, "staging")
|
33
|
+
end
|
34
|
+
|
35
|
+
it "publish only gzip files when option is enabled" do
|
36
|
+
Aws::S3::Client.any_instance.expects(:put_object).times(4)
|
37
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
38
|
+
"spec/sample", "", "cf123", [], [], true, {}, "staging")
|
39
|
+
end
|
40
|
+
|
41
|
+
context "with invalidations" do
|
42
|
+
it "publish all files with invalidations" do
|
43
|
+
Aws::S3::Client.any_instance.expects(:put_object).times(8)
|
44
|
+
Aws::CloudFront::Client.any_instance.expects(:create_invalidation).once
|
45
|
+
|
46
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
47
|
+
"spec/sample", "", "cf123", ["*"], [], false, {}, "staging")
|
48
|
+
end
|
49
|
+
|
50
|
+
it "publish all files without invalidations" do
|
51
|
+
Aws::S3::Client.any_instance.expects(:put_object).times(8)
|
52
|
+
Aws::CloudFront::Client.any_instance.expects(:create_invalidation).never
|
53
|
+
|
54
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
55
|
+
"spec/sample", "", "cf123", [], [], false, {}, "staging")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context "with exclusions" do
|
60
|
+
it "exclude one files" do
|
61
|
+
Aws::S3::Client.any_instance.expects(:put_object).times(7)
|
62
|
+
|
63
|
+
exclude_paths = ["fonts/cantarell-regular-webfont.svg"]
|
64
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
65
|
+
"spec/sample", "", "cf123", [], exclude_paths, false, {},
|
66
|
+
"staging")
|
67
|
+
end
|
68
|
+
|
69
|
+
it "exclude multiple files" do
|
70
|
+
Aws::S3::Client.any_instance.expects(:put_object).times(6)
|
71
|
+
|
72
|
+
exclude_paths = ["fonts/cantarell-regular-webfont.svg",
|
73
|
+
"fonts/cantarell-regular-webfont.svg.gz"]
|
74
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
75
|
+
"spec/sample", "", "cf123", [], exclude_paths, false, {},
|
76
|
+
"staging")
|
77
|
+
end
|
78
|
+
|
79
|
+
it "exclude directory" do
|
80
|
+
Aws::S3::Client.any_instance.expects(:put_object).times(0)
|
81
|
+
|
82
|
+
exclude_paths = ["fonts/**/*"]
|
83
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
84
|
+
"spec/sample", "", "cf123", [], exclude_paths, false, {},
|
85
|
+
"staging")
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context "with write options" do
|
90
|
+
it "sets bucket write options to all files" do
|
91
|
+
headers = { cache_control: "no-cache" }
|
92
|
+
extra_options = { write: headers }
|
93
|
+
|
94
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
95
|
+
contains(options, headers)
|
96
|
+
end.times(3)
|
97
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
98
|
+
"spec/sample-write", "", "cf123", [], [], false, extra_options,
|
99
|
+
"staging")
|
100
|
+
end
|
101
|
+
|
102
|
+
it "sets object write options to a single file" do
|
103
|
+
headers = { cache_control: "no-cache", acl: :private }
|
104
|
+
extra_options = {
|
105
|
+
object_write: {
|
106
|
+
"index.html" => headers
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
111
|
+
options[:key] == "index.html" && contains(options, headers)
|
112
|
+
end.once
|
113
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
114
|
+
options[:key] != "index.html" && !contains(options, headers)
|
115
|
+
end.twice
|
116
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
117
|
+
"spec/sample-write", "", "cf123", [], [], false, extra_options,
|
118
|
+
"staging")
|
119
|
+
end
|
120
|
+
|
121
|
+
it "sets object write options to a directory" do
|
122
|
+
asset_headers = { cache_control: "max-age=3600" }
|
123
|
+
index_headers = { cache_control: "no-cache" }
|
124
|
+
extra_options = {
|
125
|
+
object_write: {
|
126
|
+
"assets/**" => asset_headers,
|
127
|
+
"index.html" => index_headers
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
132
|
+
options[:key] == "index.html" && !contains(options, asset_headers) &&
|
133
|
+
contains(options, index_headers)
|
134
|
+
end.once
|
135
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
136
|
+
options[:key] != "index.html" &&
|
137
|
+
!contains(options, index_headers) &&
|
138
|
+
contains(options, asset_headers)
|
139
|
+
end.twice
|
140
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
141
|
+
"spec/sample-write", "", "cf123", [], [], false, extra_options,
|
142
|
+
"staging")
|
143
|
+
end
|
144
|
+
|
145
|
+
it "sets object write permissions in the order of definition" do
|
146
|
+
asset_headers = { cache_control: "max-age=3600" }
|
147
|
+
js_headers = { cache_control: "no-cache" }
|
148
|
+
extra_options = {
|
149
|
+
object_write: { "assets/**" => asset_headers, "assets/script.js" => js_headers }
|
150
|
+
}
|
151
|
+
|
152
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
153
|
+
options[:key] == "assets/script.js" && !contains(options, asset_headers) &&
|
154
|
+
contains(options, js_headers)
|
155
|
+
end.once
|
156
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
157
|
+
options[:key] == "assets/style.css" && !contains(options, js_headers) &&
|
158
|
+
contains(options, asset_headers)
|
159
|
+
end.once
|
160
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
161
|
+
options[:key] == "index.html" && !contains(options, js_headers) &&
|
162
|
+
!contains(options, asset_headers)
|
163
|
+
end.once
|
164
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
165
|
+
"spec/sample-write", "", "cf123", [], [], false, extra_options,
|
166
|
+
"staging")
|
167
|
+
end
|
168
|
+
|
169
|
+
it "overwrites object write permissions with wrong ordering" do
|
170
|
+
js_headers = { cache_control: "no-cache" }
|
171
|
+
asset_headers = { cache_control: "max-age=3600" }
|
172
|
+
extra_options = {
|
173
|
+
object_write: {
|
174
|
+
"assets/script.js" => js_headers,
|
175
|
+
"assets/**" => asset_headers
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
180
|
+
options[:key] != "index.html" && !contains(options, js_headers) &&
|
181
|
+
contains(options, asset_headers)
|
182
|
+
end.twice
|
183
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
184
|
+
options[:key] == "index.html" && !contains(options, js_headers) &&
|
185
|
+
!contains(options, asset_headers)
|
186
|
+
end.once
|
187
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
188
|
+
"spec/sample-write", "", "cf123", [], [], false, extra_options,
|
189
|
+
"staging")
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
context "with MIME types" do
|
194
|
+
it "sets best match MIME type by default" do
|
195
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
196
|
+
options[:content_type] == "application/javascript"
|
197
|
+
end.once
|
198
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
199
|
+
"spec/sample-mime", "", "cf123", [], [], false, {}, "staging")
|
200
|
+
end
|
201
|
+
|
202
|
+
it "sets CloudFront preferred MIME type if needed" do
|
203
|
+
extra_options = { prefer_cf_mime_types: true }
|
204
|
+
|
205
|
+
Aws::S3::Client.any_instance.expects(:put_object).with do |options|
|
206
|
+
options[:content_type] == "application/javascript"
|
207
|
+
end.once
|
208
|
+
described_class.publish!("s3.amazonaws.com", "abc", "123", "mybucket.amazonaws.com",
|
209
|
+
"spec/sample-mime", "", "cf123", [], [], false, extra_options,
|
210
|
+
"staging")
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
const test = 'test';
|
@@ -0,0 +1 @@
|
|
1
|
+
const test = 'test';
|
data/spec/spec_helper.rb
CHANGED
@@ -1,8 +1,14 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "capistrano/s3/publisher"
|
4
|
+
require "mocha/api"
|
3
5
|
|
4
6
|
Aws.config[:stub_responses] = true
|
5
7
|
|
6
8
|
RSpec.configure do |config|
|
7
9
|
config.mock_framework = :mocha
|
8
10
|
end
|
11
|
+
|
12
|
+
def contains(options, extra_options)
|
13
|
+
options.merge(extra_options) == options
|
14
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Philippe Doyle
|
@@ -10,37 +10,37 @@ authors:
|
|
10
10
|
- Douglas Jarquin
|
11
11
|
- Amit Barvaz
|
12
12
|
- Jan Lindblom
|
13
|
-
autorequire:
|
13
|
+
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain:
|
16
16
|
- |
|
17
17
|
-----BEGIN CERTIFICATE-----
|
18
18
|
MIIETTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB1hbGVr
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
19
|
+
c2FuZHJzL0RDPWxlZG92c2tpcy9EQz1sdjAeFw0yNTA3MDMyMDA3NTNaFw0zNTA3
|
20
|
+
MDEyMDA3NTNaMCgxJjAkBgNVBAMMHWFsZWtzYW5kcnMvREM9bGVkb3Zza2lzL0RD
|
21
|
+
PWx2MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEArXlVsZ09UgURfoX1
|
22
|
+
hX/9A/01rGvyKjfFdx3Ak+Z7lEeVM9FJ5TX8krgEcuwnJG4eIDoyv5jLB3amOSaV
|
23
|
+
ZBRkP7Eacwd7m5QVE6P4scjC8KzrpwYqj8d/SgV22ISHsdNGaBkSs4x1wL15BTHs
|
24
|
+
FzWHg8sVWqo5ogThrje+b7/9b+mLj6DZt3x5NZiuW3rPr+sYrnVwW4+TdIiGAX5W
|
25
|
+
bSVCll0zls9oWQuaN9vN5GybnvOjL1eKzhAlymxXnfA9qS9RezLZPL6O6/XXv0A+
|
26
|
+
iRh4rmL1Ip16hhvMWhxRohUmXrsroQzPUnlAQL/ZU3DrcYBARJZFQ5eSTBCJy5gS
|
27
|
+
NFOjqWng6zEFt26oF64YdYZIz/ZTKYqpiPPUx5fArtglRyu58hahqwjq/e0L4beG
|
28
|
+
zNkppUkvhIvfFOE7aUG/CXGiaRMjiMqriG6Tw1edIhFVgyZIQMJ5n7zZ68BApYkR
|
29
|
+
T0r64McVnpWBma4sHsU1eH7WLwPfrWAEOc1YHGEffjI05wXHAgMBAAGjgYEwfzAJ
|
30
|
+
BgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQULuQtQCcfTy1F69VRoxzL
|
31
|
+
AGDq9/8wIgYDVR0RBBswGYEXYWxla3NhbmRyc0BsZWRvdnNraXMubHYwIgYDVR0S
|
32
32
|
BBswGYEXYWxla3NhbmRyc0BsZWRvdnNraXMubHYwDQYJKoZIhvcNAQELBQADggGB
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
33
|
+
ACB+YqgrDHy6yN5EEGMO5S+Dfjydawx21f3ez5e4r+ZbW4AKByziFO6HcQnI6jc/
|
34
|
+
mWlX4Lzx8KZJd38lmayVjt9SANC+U5ZLcgg0CpoY8yjEilJFMRL5x2P0Tcz/YIp5
|
35
|
+
1zV/FCGw9vy80jKwoYrLaQ7aIilxJsee1WpyChVzhRJPje5oIDGQxo+tfVZmQWBH
|
36
|
+
EDY5Mm7j4yDZYXsgO1w/fa0d39yJnrBoJVNuUHZblD759fdTIPDlJxumkh0h+2ut
|
37
|
+
kD4D+piMRFvPXiuILI+oDBFHzLTxAr9nixsO5Bxj0uOXuc/ngm8lMAXuJE9gMRP3
|
38
|
+
vYIQSMxeKnpiMPX1vZdbeXUVyq3G7gtpaE1k4XD+A6c9iXSSfGke4AVwjXM8eaQp
|
39
|
+
riL/tAnKoqvvpMAEZL7vHUCw0ZQ45ztmlp9HdKxlkgJrV4qfAa8QRFW5S4HCl49e
|
40
|
+
CsE82Lenc1R7eDd2E2TpIHGXeHy2ZQAfRLt8r56Qx4SlfpxtaW7j8Y4iQPysBmVI
|
41
|
+
pA==
|
42
42
|
-----END CERTIFICATE-----
|
43
|
-
date:
|
43
|
+
date: 2025-07-03 00:00:00.000000000 Z
|
44
44
|
dependencies:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: aws-sdk
|
@@ -85,69 +85,13 @@ dependencies:
|
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
|
-
name:
|
88
|
+
name: webrick
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
91
|
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
|
-
type: :
|
95
|
-
prerelease: false
|
96
|
-
version_requirements: !ruby/object:Gem::Requirement
|
97
|
-
requirements:
|
98
|
-
- - ">="
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: '0'
|
101
|
-
- !ruby/object:Gem::Dependency
|
102
|
-
name: rspec
|
103
|
-
requirement: !ruby/object:Gem::Requirement
|
104
|
-
requirements:
|
105
|
-
- - ">="
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
version: '0'
|
108
|
-
type: :development
|
109
|
-
prerelease: false
|
110
|
-
version_requirements: !ruby/object:Gem::Requirement
|
111
|
-
requirements:
|
112
|
-
- - ">="
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
version: '0'
|
115
|
-
- !ruby/object:Gem::Dependency
|
116
|
-
name: mocha
|
117
|
-
requirement: !ruby/object:Gem::Requirement
|
118
|
-
requirements:
|
119
|
-
- - ">="
|
120
|
-
- !ruby/object:Gem::Version
|
121
|
-
version: '0'
|
122
|
-
type: :development
|
123
|
-
prerelease: false
|
124
|
-
version_requirements: !ruby/object:Gem::Requirement
|
125
|
-
requirements:
|
126
|
-
- - ">="
|
127
|
-
- !ruby/object:Gem::Version
|
128
|
-
version: '0'
|
129
|
-
- !ruby/object:Gem::Dependency
|
130
|
-
name: awesome_print
|
131
|
-
requirement: !ruby/object:Gem::Requirement
|
132
|
-
requirements:
|
133
|
-
- - ">="
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
version: '0'
|
136
|
-
type: :development
|
137
|
-
prerelease: false
|
138
|
-
version_requirements: !ruby/object:Gem::Requirement
|
139
|
-
requirements:
|
140
|
-
- - ">="
|
141
|
-
- !ruby/object:Gem::Version
|
142
|
-
version: '0'
|
143
|
-
- !ruby/object:Gem::Dependency
|
144
|
-
name: gem-release
|
145
|
-
requirement: !ruby/object:Gem::Requirement
|
146
|
-
requirements:
|
147
|
-
- - ">="
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: '0'
|
150
|
-
type: :development
|
94
|
+
type: :runtime
|
151
95
|
prerelease: false
|
152
96
|
version_requirements: !ruby/object:Gem::Requirement
|
153
97
|
requirements:
|
@@ -163,26 +107,32 @@ executables: []
|
|
163
107
|
extensions: []
|
164
108
|
extra_rdoc_files: []
|
165
109
|
files:
|
110
|
+
- ".github/workflows/build.yml"
|
166
111
|
- ".gitignore"
|
167
|
-
- ".
|
112
|
+
- ".rubocop.yml"
|
168
113
|
- CHANGELOG.md
|
169
114
|
- CONTRIBUTING.md
|
170
115
|
- Gemfile
|
116
|
+
- Guardfile
|
171
117
|
- LICENSE
|
172
118
|
- README.md
|
173
119
|
- Rakefile
|
174
120
|
- capistrano-s3.gemspec
|
175
|
-
- certs/aleksandrs-ledovskis--
|
176
|
-
- certs/j15e.pem
|
121
|
+
- certs/aleksandrs-ledovskis--2025-07-03-2035-07-01.pem
|
177
122
|
- lib/capistrano/s3.rb
|
178
123
|
- lib/capistrano/s3/defaults.rb
|
124
|
+
- lib/capistrano/s3/mime_types.rb
|
179
125
|
- lib/capistrano/s3/publisher.rb
|
180
126
|
- lib/capistrano/s3/version.rb
|
181
127
|
- lib/capistrano/tasks/capistrano_2.rb
|
182
128
|
- lib/capistrano/tasks/capistrano_3.rb
|
183
|
-
- spec/publisher_spec.rb
|
129
|
+
- spec/capistrano/s3/publisher_spec.rb
|
184
130
|
- spec/sample-2/.well-known/test.txt
|
185
131
|
- spec/sample-2/public/.htaccess
|
132
|
+
- spec/sample-mime/script.js
|
133
|
+
- spec/sample-write/assets/script.js
|
134
|
+
- spec/sample-write/assets/style.css
|
135
|
+
- spec/sample-write/index.html
|
186
136
|
- spec/sample/fonts/cantarell-regular-webfont.eot
|
187
137
|
- spec/sample/fonts/cantarell-regular-webfont.eot.gz
|
188
138
|
- spec/sample/fonts/cantarell-regular-webfont.svg
|
@@ -195,8 +145,9 @@ files:
|
|
195
145
|
homepage: https://github.com/capistrano-s3/capistrano-s3
|
196
146
|
licenses:
|
197
147
|
- MIT
|
198
|
-
metadata:
|
199
|
-
|
148
|
+
metadata:
|
149
|
+
rubygems_mfa_required: 'true'
|
150
|
+
post_install_message:
|
200
151
|
rdoc_options: []
|
201
152
|
require_paths:
|
202
153
|
- lib
|
@@ -204,28 +155,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
204
155
|
requirements:
|
205
156
|
- - ">="
|
206
157
|
- !ruby/object:Gem::Version
|
207
|
-
version:
|
158
|
+
version: 2.5.0
|
208
159
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
160
|
requirements:
|
210
|
-
- - "
|
161
|
+
- - ">"
|
211
162
|
- !ruby/object:Gem::Version
|
212
|
-
version:
|
163
|
+
version: 1.3.1
|
213
164
|
requirements: []
|
214
|
-
|
215
|
-
|
216
|
-
signing_key:
|
165
|
+
rubygems_version: 3.4.10
|
166
|
+
signing_key:
|
217
167
|
specification_version: 4
|
218
168
|
summary: Build and deploy a static website to Amazon S3
|
219
|
-
test_files:
|
220
|
-
- spec/publisher_spec.rb
|
221
|
-
- spec/sample-2/.well-known/test.txt
|
222
|
-
- spec/sample-2/public/.htaccess
|
223
|
-
- spec/sample/fonts/cantarell-regular-webfont.eot
|
224
|
-
- spec/sample/fonts/cantarell-regular-webfont.eot.gz
|
225
|
-
- spec/sample/fonts/cantarell-regular-webfont.svg
|
226
|
-
- spec/sample/fonts/cantarell-regular-webfont.svg.gz
|
227
|
-
- spec/sample/fonts/cantarell-regular-webfont.ttf
|
228
|
-
- spec/sample/fonts/cantarell-regular-webfont.ttf.gz
|
229
|
-
- spec/sample/fonts/cantarell-regular-webfont.woff
|
230
|
-
- spec/sample/fonts/cantarell-regular-webfont.woff.gz
|
231
|
-
- spec/spec_helper.rb
|
169
|
+
test_files: []
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
(�H+��b�*1c�,�
|
2
|
+
�Ћf����?��q��<��'���L�&�J�]� �����U$8A�a���]��ķ��X�d�r+}���Z����̽P6���luK�SA��ܛ�/Qq��
|
3
|
+
Q��,���1�Ζ����4-��hؽ���B��iµ>[��m6wI��g�g�@��Q��,MZ11.����,�
|
4
|
+
�Mg��u|Sfz!�$u��i!�\P�⹀����\xw�7��q�QQ�e�����~����U��^N���gdK�;�8?��oE�P���r8�**��(�;�y�(�2�r�-�5�kq�8Jc�� �l@^�u�z����!��5�]��/?q�W�e
|
data/.travis.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
notifications:
|
2
|
-
email:
|
3
|
-
on_success: never
|
4
|
-
on_failure: change
|
5
|
-
language: ruby
|
6
|
-
dist: trusty
|
7
|
-
bundler_args: --without debug release
|
8
|
-
before_install:
|
9
|
-
- ruby -v | (grep -v "rubinius" && gem install bundler) || echo 0
|
10
|
-
rvm:
|
11
|
-
- 2.2.7
|
12
|
-
- 2.3.4
|
13
|
-
- 2.4.1
|
14
|
-
- rbx-3.75
|
15
|
-
- jruby-9.1.5.0
|
16
|
-
- jruby-head
|
17
|
-
- ruby-head
|
18
|
-
matrix:
|
19
|
-
allow_failures:
|
20
|
-
- rvm: jruby-head
|
21
|
-
- rvm: ruby-head
|
@@ -1,26 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIETTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB1hbGVr
|
3
|
-
c2FuZHJzL0RDPWxlZG92c2tpcy9EQz1sdjAeFw0xODExMDQxNTE2NDdaFw0yMDEx
|
4
|
-
MDMx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q46UCeaFMs5wGcniT7XhuDcqPQaqCIxDE1aBxcKlZg8i62yM3BO/yX5DwLPqhyEu
|
10
|
-
XVViJ+PvHjUGa69iw1fqUs9PZaf9WdKHyPHhgbhwy7xqx7EavG+tmHQUxtIf7xhl
|
11
|
-
OU80hUsHQrkj5PxPU2Qfs6q2jOxrfRcUSBJZxUDzjmbhP9eq0XN+b5/Cqz3OboSI
|
12
|
-
nWF0Kj0971wJgZiNdzXsLMy+zmHdiQIDAQABo4GMMIGJMAkGA1UdEwQCMAAwCwYD
|
13
|
-
VR0PBAQDAgSwMB0GA1UdDgQWBBRro81JisHXRBP5dZh5mzOEHsjLxTAnBgNVHREE
|
14
|
-
IDAegRxqZWFucGhpbGlwcGUuZG95bGVAZ21haWwuY29tMCcGA1UdEgQgMB6BHGpl
|
15
|
-
YW5waGlsaXBwZS5kb3lsZUBnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQADggEBADsn
|
16
|
-
80BmZ9LcnXzKOvNFts/L230YyUuRvsSFhLpfTJqmvDmfjBWrtL6pXxnES79Ioshd
|
17
|
-
zWSLZ1XYWwPFVDYODq+eupjVg2/DBSdOcMjwdrMP84nZeOS5AumogydbC8j22ETx
|
18
|
-
Yal+NgwHw8x1+loPGm5ZLrRFgyMnDrhUnG0pFDEd4/rMpUlnG17eGeWq2Zr3Q5q+
|
19
|
-
mj7phtPsRLGRWLV5ba9ROJYoASdZtQadvQMHvDOoYY9+vprJ8sYQJkBz6hRJrg30
|
20
|
-
t/JsZnAlWYkJIees2SFV5X/t34oeMu04yY2u9y2YBqKovR97m5YF7zqgx0JODV0x
|
21
|
-
ytwUJvEjznBnJV4OoDE=
|
22
|
-
-----END CERTIFICATE-----
|
data/spec/publisher_spec.rb
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Capistrano::S3::Publisher do
|
4
|
-
before do
|
5
|
-
@root = File.expand_path('../', __FILE__)
|
6
|
-
publish_file = Capistrano::S3::Publisher::LAST_PUBLISHED_FILE
|
7
|
-
FileUtils.rm(publish_file) if File.exist?(publish_file)
|
8
|
-
end
|
9
|
-
|
10
|
-
describe "::files" do
|
11
|
-
subject(:files) { described_class.files(deployment_path, exclusions) }
|
12
|
-
|
13
|
-
let(:deployment_path) { "spec/sample-2" }
|
14
|
-
let(:exclusions) { [] }
|
15
|
-
|
16
|
-
it "includes dot-prefixed/hidden directories" do
|
17
|
-
expect(files).to include("spec/sample-2/.well-known/test.txt")
|
18
|
-
end
|
19
|
-
|
20
|
-
it "includes dot-prefixed/hidden files" do
|
21
|
-
expect(files).to include("spec/sample-2/public/.htaccess")
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
context "on publish!" do
|
26
|
-
it "publish all files" do
|
27
|
-
Aws::S3::Client.any_instance.expects(:put_object).times(8)
|
28
|
-
Capistrano::S3::Publisher.publish!('s3.amazonaws.com', 'abc', '123', 'mybucket.amazonaws.com', 'spec/sample', '', 'cf123', [], [], false, {}, 'staging')
|
29
|
-
end
|
30
|
-
|
31
|
-
it "publish only gzip files when option is enabled" do
|
32
|
-
Aws::S3::Client.any_instance.expects(:put_object).times(4)
|
33
|
-
Capistrano::S3::Publisher.publish!('s3.amazonaws.com', 'abc', '123', 'mybucket.amazonaws.com', 'spec/sample', '', 'cf123', [], [], true, {}, 'staging')
|
34
|
-
end
|
35
|
-
|
36
|
-
context "invalidations" do
|
37
|
-
it "publish all files with invalidations" do
|
38
|
-
Aws::S3::Client.any_instance.expects(:put_object).times(8)
|
39
|
-
Aws::CloudFront::Client.any_instance.expects(:create_invalidation).once
|
40
|
-
|
41
|
-
Capistrano::S3::Publisher.publish!('s3.amazonaws.com', 'abc', '123', 'mybucket.amazonaws.com', 'spec/sample', '', 'cf123', ['*'], [], false, {}, 'staging')
|
42
|
-
end
|
43
|
-
|
44
|
-
it "publish all files without invalidations" do
|
45
|
-
Aws::S3::Client.any_instance.expects(:put_object).times(8)
|
46
|
-
Aws::CloudFront::Client.any_instance.expects(:create_invalidation).never
|
47
|
-
|
48
|
-
Capistrano::S3::Publisher.publish!('s3.amazonaws.com', 'abc', '123', 'mybucket.amazonaws.com', 'spec/sample', '', 'cf123', [], [], false, {}, 'staging')
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
context "exclusions" do
|
53
|
-
it "exclude one files" do
|
54
|
-
Aws::S3::Client.any_instance.expects(:put_object).times(7)
|
55
|
-
|
56
|
-
exclude_paths = ['fonts/cantarell-regular-webfont.svg']
|
57
|
-
Capistrano::S3::Publisher.publish!('s3.amazonaws.com', 'abc', '123', 'mybucket.amazonaws.com', 'spec/sample', '', 'cf123', [], exclude_paths, false, {}, 'staging')
|
58
|
-
end
|
59
|
-
|
60
|
-
it "exclude multiple files" do
|
61
|
-
Aws::S3::Client.any_instance.expects(:put_object).times(6)
|
62
|
-
|
63
|
-
exclude_paths = ['fonts/cantarell-regular-webfont.svg', 'fonts/cantarell-regular-webfont.svg.gz']
|
64
|
-
Capistrano::S3::Publisher.publish!('s3.amazonaws.com', 'abc', '123', 'mybucket.amazonaws.com', 'spec/sample', '', 'cf123', [], exclude_paths, false, {}, 'staging')
|
65
|
-
end
|
66
|
-
|
67
|
-
it "exclude directory" do
|
68
|
-
Aws::S3::Client.any_instance.expects(:put_object).times(0)
|
69
|
-
|
70
|
-
exclude_paths = ['fonts/**/*']
|
71
|
-
Capistrano::S3::Publisher.publish!('s3.amazonaws.com', 'abc', '123', 'mybucket.amazonaws.com', 'spec/sample', '', 'cf123', [], exclude_paths, false, {}, 'staging')
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|