s3_website_monadic 0.0.1

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.
Files changed (151) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.travis.yml +3 -0
  4. data/Gemfile +3 -0
  5. data/LICENSE +42 -0
  6. data/README.md +451 -0
  7. data/Rakefile +24 -0
  8. data/additional-docs/example-configurations.md +62 -0
  9. data/additional-docs/setting-up-aws-credentials.md +51 -0
  10. data/assembly.sbt +3 -0
  11. data/bin/s3_website +80 -0
  12. data/build.sbt +33 -0
  13. data/changelog.md +215 -0
  14. data/features/as-library.feature +29 -0
  15. data/features/cassettes/cucumber_tags/create-redirect.yml +384 -0
  16. data/features/cassettes/cucumber_tags/empty-bucket.yml +89 -0
  17. data/features/cassettes/cucumber_tags/new-and-changed-files.yml +303 -0
  18. data/features/cassettes/cucumber_tags/new-files-for-sydney.yml +211 -0
  19. data/features/cassettes/cucumber_tags/new-files.yml +355 -0
  20. data/features/cassettes/cucumber_tags/no-new-or-changed-files.yml +359 -0
  21. data/features/cassettes/cucumber_tags/one-file-to-delete.yml +390 -0
  22. data/features/cassettes/cucumber_tags/only-changed-files.yml +411 -0
  23. data/features/cassettes/cucumber_tags/s3-and-cloudfront-after-deleting-a-file.yml +434 -0
  24. data/features/cassettes/cucumber_tags/s3-and-cloudfront-when-updating-a-file.yml +435 -0
  25. data/features/cassettes/cucumber_tags/s3-and-cloudfront.yml +290 -0
  26. data/features/cloudfront.feature +54 -0
  27. data/features/command-line-help.feature +54 -0
  28. data/features/delete.feature +19 -0
  29. data/features/error_reporting.feature +24 -0
  30. data/features/instructions-for-new-user.feature +154 -0
  31. data/features/jekyll-support.feature +20 -0
  32. data/features/nanoc-support.feature +20 -0
  33. data/features/push.feature +115 -0
  34. data/features/redirects.feature +14 -0
  35. data/features/security.feature +15 -0
  36. data/features/step_definitions/steps.rb +86 -0
  37. data/features/support/env.rb +26 -0
  38. data/features/support/test_site_dirs/cdn-powered.blog.fi/_site/css/styles.css +3 -0
  39. data/features/support/test_site_dirs/cdn-powered.blog.fi/_site/index.html +5 -0
  40. data/features/support/test_site_dirs/cdn-powered.blog.fi/s3_website.yml +4 -0
  41. data/features/support/test_site_dirs/cdn-powered.when-deleted-a-file.blog.fi/_site/index.html +10 -0
  42. data/features/support/test_site_dirs/cdn-powered.when-deleted-a-file.blog.fi/s3_website.yml +5 -0
  43. data/features/support/test_site_dirs/cdn-powered.with-one-change.blog.fi/_site/css/styles.css +3 -0
  44. data/features/support/test_site_dirs/cdn-powered.with-one-change.blog.fi/_site/index.html +10 -0
  45. data/features/support/test_site_dirs/cdn-powered.with-one-change.blog.fi/s3_website.yml +4 -0
  46. data/features/support/test_site_dirs/create-redirects/_site/.gitkeep +0 -0
  47. data/features/support/test_site_dirs/create-redirects/s3_website.yml +6 -0
  48. data/features/support/test_site_dirs/ignored-files.com/_site/css/styles.css +4 -0
  49. data/features/support/test_site_dirs/ignored-files.com/_site/index.html +8 -0
  50. data/features/support/test_site_dirs/ignored-files.com/s3_website.yml +5 -0
  51. data/features/support/test_site_dirs/index-and-assets.blog.fi/_site/assets/picture.gif +0 -0
  52. data/features/support/test_site_dirs/index-and-assets.blog.fi/_site/css/styles.css +3 -0
  53. data/features/support/test_site_dirs/index-and-assets.blog.fi/_site/index.html +5 -0
  54. data/features/support/test_site_dirs/index-and-assets.blog.fi/s3_website.yml +3 -0
  55. data/features/support/test_site_dirs/jekyllrb.com/_site/css/styles.css +3 -0
  56. data/features/support/test_site_dirs/jekyllrb.com/_site/index.html +5 -0
  57. data/features/support/test_site_dirs/jekyllrb.com/s3_website.yml +3 -0
  58. data/features/support/test_site_dirs/my.blog-with-clean-urls.com/_site/css/styles.css +3 -0
  59. data/features/support/test_site_dirs/my.blog-with-clean-urls.com/_site/index +5 -0
  60. data/features/support/test_site_dirs/my.blog-with-clean-urls.com/s3_website.yml +3 -0
  61. data/features/support/test_site_dirs/my.blog.com/_site/css/styles.css +3 -0
  62. data/features/support/test_site_dirs/my.blog.com/_site/index.html +5 -0
  63. data/features/support/test_site_dirs/my.blog.com/s3_website.yml +3 -0
  64. data/features/support/test_site_dirs/my.sydney.blog.au/_site/css/styles.css +3 -0
  65. data/features/support/test_site_dirs/my.sydney.blog.au/_site/index.html +5 -0
  66. data/features/support/test_site_dirs/my.sydney.blog.au/s3_website.yml +4 -0
  67. data/features/support/test_site_dirs/nanoc.ws/public/output/css/styles.css +3 -0
  68. data/features/support/test_site_dirs/nanoc.ws/public/output/index.html +5 -0
  69. data/features/support/test_site_dirs/nanoc.ws/s3_website.yml +3 -0
  70. data/features/support/test_site_dirs/new-and-changed-files.com/_site/css/styles.css +4 -0
  71. data/features/support/test_site_dirs/new-and-changed-files.com/_site/index.html +8 -0
  72. data/features/support/test_site_dirs/new-and-changed-files.com/s3_website.yml +3 -0
  73. data/features/support/test_site_dirs/no-new-or-changed-files.com/_site/css/styles.css +3 -0
  74. data/features/support/test_site_dirs/no-new-or-changed-files.com/_site/index.html +5 -0
  75. data/features/support/test_site_dirs/no-new-or-changed-files.com/s3_website.yml +3 -0
  76. data/features/support/test_site_dirs/only-changed-files.com/_site/css/styles.css +3 -0
  77. data/features/support/test_site_dirs/only-changed-files.com/_site/index.html +9 -0
  78. data/features/support/test_site_dirs/only-changed-files.com/s3_website.yml +3 -0
  79. data/features/support/test_site_dirs/site-that-contains-s3-website-file.com/_site/s3_website.yml +3 -0
  80. data/features/support/test_site_dirs/site-that-contains-s3-website-file.com/s3_website.yml +3 -0
  81. data/features/support/test_site_dirs/site-with-text-doc.com/_site/file.txt +1 -0
  82. data/features/support/test_site_dirs/site.with.css-maxage.com/_site/css/styles.css +3 -0
  83. data/features/support/test_site_dirs/site.with.css-maxage.com/_site/index.html +5 -0
  84. data/features/support/test_site_dirs/site.with.css-maxage.com/s3_website.yml +5 -0
  85. data/features/support/test_site_dirs/site.with.gzipped-and-max-aged-content.com/_site/css/styles.css +3 -0
  86. data/features/support/test_site_dirs/site.with.gzipped-and-max-aged-content.com/_site/index.html +5 -0
  87. data/features/support/test_site_dirs/site.with.gzipped-and-max-aged-content.com/s3_website.yml +5 -0
  88. data/features/support/test_site_dirs/site.with.gzipped-html.com/_site/css/styles.css +3 -0
  89. data/features/support/test_site_dirs/site.with.gzipped-html.com/_site/index.html +5 -0
  90. data/features/support/test_site_dirs/site.with.gzipped-html.com/s3_website.yml +5 -0
  91. data/features/support/test_site_dirs/site.with.maxage.com/_site/css/styles.css +3 -0
  92. data/features/support/test_site_dirs/site.with.maxage.com/_site/index.html +5 -0
  93. data/features/support/test_site_dirs/site.with.maxage.com/s3_website.yml +4 -0
  94. data/features/support/test_site_dirs/unpublish-a-post.com/_site/css/styles.css +3 -0
  95. data/features/support/test_site_dirs/unpublish-a-post.com/s3_website.yml +3 -0
  96. data/features/support/vcr.rb +20 -0
  97. data/features/website-performance.feature +57 -0
  98. data/lib/cloudfront/invalidator.rb +37 -0
  99. data/lib/s3_website/config_loader.rb +55 -0
  100. data/lib/s3_website/diff_helper.rb +113 -0
  101. data/lib/s3_website/endpoint.rb +37 -0
  102. data/lib/s3_website/errors.rb +42 -0
  103. data/lib/s3_website/jekyll.rb +5 -0
  104. data/lib/s3_website/keyboard.rb +27 -0
  105. data/lib/s3_website/nanoc.rb +5 -0
  106. data/lib/s3_website/parallelism.rb +25 -0
  107. data/lib/s3_website/paths.rb +39 -0
  108. data/lib/s3_website/retry.rb +19 -0
  109. data/lib/s3_website/tasks.rb +36 -0
  110. data/lib/s3_website/upload.rb +137 -0
  111. data/lib/s3_website/uploader.rb +177 -0
  112. data/lib/s3_website.rb +34 -0
  113. data/project/assembly.sbt +1 -0
  114. data/project/build.properties +0 -0
  115. data/project/plugins.sbt +1 -0
  116. data/project/sbt-launch-0.13.2.jar +0 -0
  117. data/resources/configuration_file_template.yml +56 -0
  118. data/s3_website.gemspec +41 -0
  119. data/sbt +4 -0
  120. data/spec/lib/cloudfront/invalidator_spec.rb +60 -0
  121. data/spec/lib/config_loader_spec.rb +20 -0
  122. data/spec/lib/endpoint_spec.rb +31 -0
  123. data/spec/lib/error_spec.rb +21 -0
  124. data/spec/lib/keyboard_spec.rb +62 -0
  125. data/spec/lib/parallelism_spec.rb +81 -0
  126. data/spec/lib/paths_spec.rb +7 -0
  127. data/spec/lib/retry_spec.rb +34 -0
  128. data/spec/lib/upload_spec.rb +303 -0
  129. data/spec/lib/uploader_spec.rb +37 -0
  130. data/spec/sample_files/hyde_site/_site/.vimrc +5 -0
  131. data/spec/sample_files/hyde_site/_site/css/styles.css +3 -0
  132. data/spec/sample_files/hyde_site/_site/index.html +1 -0
  133. data/spec/sample_files/hyde_site/s3_website.yml +3 -0
  134. data/spec/sample_files/tokyo_site/_site/.vimrc +5 -0
  135. data/spec/sample_files/tokyo_site/_site/css/styles.css +3 -0
  136. data/spec/sample_files/tokyo_site/_site/index.html +1 -0
  137. data/spec/sample_files/tokyo_site/s3_website.yml +4 -0
  138. data/spec/spec_helper.rb +1 -0
  139. data/src/main/scala/s3/website/CloudFront.scala +96 -0
  140. data/src/main/scala/s3/website/Diff.scala +42 -0
  141. data/src/main/scala/s3/website/Implicits.scala +7 -0
  142. data/src/main/scala/s3/website/Push.scala +191 -0
  143. data/src/main/scala/s3/website/Ruby.scala +12 -0
  144. data/src/main/scala/s3/website/S3.scala +139 -0
  145. data/src/main/scala/s3/website/model/Config.scala +152 -0
  146. data/src/main/scala/s3/website/model/S3Endpoint.scala +22 -0
  147. data/src/main/scala/s3/website/model/Site.scala +68 -0
  148. data/src/main/scala/s3/website/model/errors.scala +11 -0
  149. data/src/main/scala/s3/website/model/push.scala +192 -0
  150. data/src/test/scala/s3/website/S3WebsiteSpec.scala +445 -0
  151. metadata +508 -0
@@ -0,0 +1,290 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://s3.amazonaws.com/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - ''
12
+ User-Agent:
13
+ - aws-sdk-ruby/1.5.6 ruby/1.9.3 x86_64-darwin11.4.0
14
+ Date:
15
+ - Sun, 14 Oct 2012 17:19:58 +0300
16
+ Authorization:
17
+ - AWS
18
+ Accept:
19
+ - ! '*/*'
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ X-Amz-Id-2:
26
+ - XVTH5v7I60Us5NH8Zkjqe+hJt2pZSJufKVDZYyeWa64s44hHkHpniCmXgOwpTz44
27
+ X-Amz-Request-Id:
28
+ - 814A58953B2F1408
29
+ Date:
30
+ - Sun, 14 Oct 2012 14:20:00 GMT
31
+ Content-Type:
32
+ - application/xml
33
+ Transfer-Encoding:
34
+ - chunked
35
+ Server:
36
+ - AmazonS3
37
+ body:
38
+ encoding: US-ASCII
39
+ string: ! '<?xml version="1.0" encoding="UTF-8"?>
40
+
41
+ <ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID></ID><DisplayName></DisplayName></Owner><Buckets><Bucket><Name>s3-website-test.net</Name><CreationDate>2012-10-14T12:58:37.000Z</CreationDate></Bucket></Buckets></ListAllMyBucketsResult>'
42
+ http_version:
43
+ recorded_at: Sun, 14 Oct 2012 14:19:59 GMT
44
+ - request:
45
+ method: get
46
+ uri: https://s3.amazonaws.com/s3-website-test.net?max-keys=1000
47
+ body:
48
+ encoding: US-ASCII
49
+ string: ''
50
+ headers:
51
+ Content-Type:
52
+ - ''
53
+ User-Agent:
54
+ - aws-sdk-ruby/1.5.6 ruby/1.9.3 x86_64-darwin11.4.0
55
+ Date:
56
+ - Sun, 14 Oct 2012 17:19:59 +0300
57
+ Authorization:
58
+ - AWS
59
+ Accept:
60
+ - ! '*/*'
61
+ response:
62
+ status:
63
+ code: 200
64
+ message: OK
65
+ headers:
66
+ X-Amz-Id-2:
67
+ - kqI8qY2X6hz6gn5LkBZ5ucppTQAnEtwB/WUxm3Mpp5IP9maZEOrudhkrnSZ50L8Z
68
+ X-Amz-Request-Id:
69
+ - AA070701525DE2D7
70
+ Date:
71
+ - Sun, 14 Oct 2012 14:20:03 GMT
72
+ Content-Type:
73
+ - application/xml
74
+ Transfer-Encoding:
75
+ - chunked
76
+ Server:
77
+ - AmazonS3
78
+ body:
79
+ encoding: US-ASCII
80
+ string: ! '<?xml version="1.0" encoding="UTF-8"?>
81
+
82
+ <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>s3-website-test.net</Name><Prefix></Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><IsTruncated>false</IsTruncated></ListBucketResult>'
83
+ http_version:
84
+ recorded_at: Sun, 14 Oct 2012 14:20:01 GMT
85
+ - request:
86
+ method: put
87
+ uri: https://s3.amazonaws.com/s3-website-test.net/css/styles.css
88
+ body:
89
+ encoding: ASCII-8BIT
90
+ string: !binary |-
91
+ Ym9keSB7Cgp9Cg==
92
+ headers:
93
+ Content-Type:
94
+ - ''
95
+ Content-Length:
96
+ - '10'
97
+ User-Agent:
98
+ - aws-sdk-ruby/1.5.6 ruby/1.9.3 x86_64-darwin11.4.0
99
+ Date:
100
+ - Sun, 14 Oct 2012 17:20:01 +0300
101
+ Authorization:
102
+ - AWS
103
+ Accept:
104
+ - ! '*/*'
105
+ response:
106
+ status:
107
+ code: 200
108
+ message: OK
109
+ headers:
110
+ X-Amz-Id-2:
111
+ - yiJ0xvPzssJs1/qbY1JtU4eCcrCb7RoGKmCubzT66JE2f97jBRCh/GrDGQbhzBE0
112
+ X-Amz-Request-Id:
113
+ - A48B2F4C626AA36F
114
+ Date:
115
+ - Sun, 14 Oct 2012 14:20:04 GMT
116
+ Etag:
117
+ - ! '"8fcf43a38cbf0c502f029a50645f2374"'
118
+ Content-Length:
119
+ - '0'
120
+ Server:
121
+ - AmazonS3
122
+ body:
123
+ encoding: US-ASCII
124
+ string: ''
125
+ http_version:
126
+ recorded_at: Sun, 14 Oct 2012 14:20:02 GMT
127
+ - request:
128
+ method: put
129
+ uri: https://s3.amazonaws.com/s3-website-test.net/index.html
130
+ body:
131
+ encoding: ASCII-8BIT
132
+ string: !binary |-
133
+ PGh0bWw+CiAgPGhlYWQ+CiAgICA8dGl0bGU+aGVsbG8hPC90aXRsZT4KICA8
134
+ L2hlYWQ+CjwvaHRtbD4K
135
+ headers:
136
+ Content-Type:
137
+ - ''
138
+ Content-Length:
139
+ - '60'
140
+ User-Agent:
141
+ - aws-sdk-ruby/1.5.6 ruby/1.9.3 x86_64-darwin11.4.0
142
+ Date:
143
+ - Sun, 14 Oct 2012 17:20:02 +0300
144
+ Authorization:
145
+ - AWS
146
+ Accept:
147
+ - ! '*/*'
148
+ response:
149
+ status:
150
+ code: 200
151
+ message: OK
152
+ headers:
153
+ X-Amz-Id-2:
154
+ - jB6/sj8qczNX7hdyr0BxlkN4hbv3ztad+qTDnC6b9XY580AcWSCMKMr2j5AzB/TR
155
+ X-Amz-Request-Id:
156
+ - 9EDF08D87D4C7EA2
157
+ Date:
158
+ - Sun, 14 Oct 2012 14:20:04 GMT
159
+ Etag:
160
+ - ! '"8a8892a2b0fad281f26c0dedbff7011a"'
161
+ Content-Length:
162
+ - '0'
163
+ Server:
164
+ - AmazonS3
165
+ body:
166
+ encoding: US-ASCII
167
+ string: ''
168
+ http_version:
169
+ recorded_at: Sun, 14 Oct 2012 14:20:03 GMT
170
+ - request:
171
+ method: get
172
+ uri: https://s3.amazonaws.com/s3-website-test.net?max-keys=1000
173
+ body:
174
+ encoding: US-ASCII
175
+ string: ''
176
+ headers:
177
+ Content-Type:
178
+ - ''
179
+ User-Agent:
180
+ - aws-sdk-ruby/1.5.6 ruby/1.9.3 x86_64-darwin11.4.0
181
+ Date:
182
+ - Sun, 14 Oct 2012 17:20:03 +0300
183
+ Authorization:
184
+ - AWS
185
+ Accept:
186
+ - ! '*/*'
187
+ response:
188
+ status:
189
+ code: 200
190
+ message: OK
191
+ headers:
192
+ X-Amz-Id-2:
193
+ - 28rS+qE332bAH7P5X4xCZSTKfk41Aa8+8coL6JykVGWgook8UwngNCs+vdp+MUjU
194
+ X-Amz-Request-Id:
195
+ - FE954A121529EA60
196
+ Date:
197
+ - Sun, 14 Oct 2012 14:20:05 GMT
198
+ Content-Type:
199
+ - application/xml
200
+ Transfer-Encoding:
201
+ - chunked
202
+ Server:
203
+ - AmazonS3
204
+ body:
205
+ encoding: US-ASCII
206
+ string: ! '<?xml version="1.0" encoding="UTF-8"?>
207
+
208
+ <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>s3-website-test.net</Name><Prefix></Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><IsTruncated>false</IsTruncated><Contents><Key>css/styles.css</Key><LastModified>2012-10-14T14:20:04.000Z</LastModified><ETag>&quot;8fcf43a38cbf0c502f029a50645f2374&quot;</ETag><Size>10</Size><Owner><ID>3855ebae0f370c3dd0c8d8031863792112bd2a2cb18fa310d3f463ae0dea62f1</ID><DisplayName>fluid83</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Contents><Key>index.html</Key><LastModified>2012-10-14T14:20:04.000Z</LastModified><ETag>&quot;8a8892a2b0fad281f26c0dedbff7011a&quot;</ETag><Size>60</Size><Owner><ID>3855ebae0f370c3dd0c8d8031863792112bd2a2cb18fa310d3f463ae0dea62f1</ID><DisplayName>fluid83</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents></ListBucketResult>'
209
+ http_version:
210
+ recorded_at: Sun, 14 Oct 2012 14:20:03 GMT
211
+ - request:
212
+ method: get
213
+ uri: https://s3.amazonaws.com/s3-website-test.net?max-keys=1000
214
+ body:
215
+ encoding: US-ASCII
216
+ string: ''
217
+ headers:
218
+ Content-Type:
219
+ - ''
220
+ User-Agent:
221
+ - aws-sdk-ruby/1.5.6 ruby/1.9.3 x86_64-darwin11.4.0
222
+ Date:
223
+ - Sun, 14 Oct 2012 17:20:03 +0300
224
+ Authorization:
225
+ - AWS
226
+ Accept:
227
+ - ! '*/*'
228
+ response:
229
+ status:
230
+ code: 200
231
+ message: OK
232
+ headers:
233
+ X-Amz-Id-2:
234
+ - H8PnL8xdXT/f8NBPuBRM20MoNP3GXwCurPtToM9xm1xRz8dSWhvmZRz5gtbHLEaS
235
+ X-Amz-Request-Id:
236
+ - A88E10E350D2ABBF
237
+ Date:
238
+ - Sun, 14 Oct 2012 14:20:05 GMT
239
+ Content-Type:
240
+ - application/xml
241
+ Transfer-Encoding:
242
+ - chunked
243
+ Server:
244
+ - AmazonS3
245
+ body:
246
+ encoding: US-ASCII
247
+ string: ! '<?xml version="1.0" encoding="UTF-8"?>
248
+
249
+ <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>s3-website-test.net</Name><Prefix></Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><IsTruncated>false</IsTruncated><Contents><Key>css/styles.css</Key><LastModified>2012-10-14T14:20:04.000Z</LastModified><ETag>&quot;8fcf43a38cbf0c502f029a50645f2374&quot;</ETag><Size>10</Size><Owner><ID>3855ebae0f370c3dd0c8d8031863792112bd2a2cb18fa310d3f463ae0dea62f1</ID><DisplayName>fluid83</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Contents><Key>index.html</Key><LastModified>2012-10-14T14:20:04.000Z</LastModified><ETag>&quot;8a8892a2b0fad281f26c0dedbff7011a&quot;</ETag><Size>60</Size><Owner><ID>3855ebae0f370c3dd0c8d8031863792112bd2a2cb18fa310d3f463ae0dea62f1</ID><DisplayName>fluid83</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents></ListBucketResult>'
250
+ http_version:
251
+ recorded_at: Sun, 14 Oct 2012 14:20:04 GMT
252
+ - request:
253
+ method: post
254
+ uri: https://cloudfront.amazonaws.com/2012-05-05/distribution/foo/invalidation
255
+ body:
256
+ encoding: US-ASCII
257
+ string: ! "\n <InvalidationBatch>\n <Paths>\n <Quantity>2</Quantity>\n
258
+ \ <Items>\n [\"<Path>/css/styles.css</Path>\", \"<Path>/index.html</Path>\"]\n
259
+ \ </Items>\n </Paths>\n <CallerReference>1350224404</CallerReference>\n
260
+ \ </InvalidationBatch>\n "
261
+ headers:
262
+ X-Amz-Date:
263
+ - Sun, 14 Oct 2012 17:20:04 EEST
264
+ Content-Type:
265
+ - text/xml
266
+ Authorization:
267
+ - AWS
268
+ response:
269
+ status:
270
+ code: 201
271
+ message: Created
272
+ headers:
273
+ X-Amzn-Requestid:
274
+ - 402b2709-160a-11e2-8263-5718d272b82f
275
+ Location:
276
+ - https://cloudfront.amazonaws.com/2012-05-05/distribution/foo/invalidation/I29QRGBBZOGEZ9
277
+ Content-Type:
278
+ - text/xml
279
+ Content-Length:
280
+ - '394'
281
+ Date:
282
+ - Sun, 14 Oct 2012 14:20:06 GMT
283
+ body:
284
+ encoding: US-ASCII
285
+ string: ! '<?xml version="1.0"?>
286
+
287
+ <Invalidation xmlns="http://cloudfront.amazonaws.com/doc/2012-05-05/"><Id>I29QRGBBZOGEZ9</Id><Status>InProgress</Status><CreateTime>2012-10-14T14:20:05.839Z</CreateTime><InvalidationBatch><Paths><Quantity>2</Quantity><Items><Path>/index.html</Path><Path>/css/styles.css</Path></Items></Paths><CallerReference>1350224404</CallerReference></InvalidationBatch></Invalidation>'
288
+ http_version:
289
+ recorded_at: Sun, 14 Oct 2012 14:20:05 GMT
290
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,54 @@
1
+ Feature: Invalidate the Cloudfront distribution
2
+
3
+ In order to publish my posts
4
+ As a blogger who delivers his blog via an S3-based Cloudfront distribution
5
+ I want to run s3_website
6
+ And see, that the items in the distribution were invalidated
7
+ So that my latest updates will be immediately available to readers
8
+
9
+ @s3-and-cloudfront
10
+ Scenario: Upload to S3 and then invalidate the Cloudfront distribution
11
+ When my S3 website is in "features/support/test_site_dirs/cdn-powered.blog.fi"
12
+ And I call the push command
13
+ Then the output should contain
14
+ """
15
+ Invalidating Cloudfront items...
16
+ /
17
+ succeeded
18
+ """
19
+
20
+ @s3-and-cloudfront-when-updating-a-file
21
+ Scenario: Update a blog entry and then upload
22
+ When my S3 website is in "features/support/test_site_dirs/cdn-powered.with-one-change.blog.fi"
23
+ And I call the push command
24
+ Then the output should equal
25
+ """
26
+ Deploying features/support/test_site_dirs/cdn-powered.with-one-change.blog.fi/_site/* to s3-website-test.net
27
+ Calculating diff ... done
28
+ Uploading 1 changed file(s)
29
+ Upload index.html: Success!
30
+ Done! Go visit: http://s3-website-test.net.s3-website-us-east-1.amazonaws.com/index.html
31
+ Invalidating Cloudfront items...
32
+ /index.html
33
+ /
34
+ succeeded
35
+
36
+ """
37
+
38
+ @s3-and-cloudfront-after-deleting-a-file
39
+ Scenario: Delete a blog post and then push the website
40
+ When my S3 website is in "features/support/test_site_dirs/cdn-powered.when-deleted-a-file.blog.fi"
41
+ And I call the push command
42
+ Then the output should equal
43
+ """
44
+ Deploying features/support/test_site_dirs/cdn-powered.when-deleted-a-file.blog.fi/_site/* to s3-website-test.net
45
+ Calculating diff ... done
46
+ No new or changed files to upload
47
+ Delete css/styles.css: Success!
48
+ Done! Go visit: http://s3-website-test.net.s3-website-us-east-1.amazonaws.com/index.html
49
+ Invalidating Cloudfront items...
50
+ /css/styles.css
51
+ /
52
+ succeeded
53
+
54
+ """
@@ -0,0 +1,54 @@
1
+ Feature: displaying help text in the command-line interface
2
+
3
+ As a user
4
+ I want to see the available commands and options right on CLI
5
+ So that I don't have to browse the documentation on the web
6
+
7
+ @starts-new-os-process
8
+ Scenario: User wants to know what he can do with s3_website
9
+ When I run `s3_website`
10
+ Then the output should contain:
11
+ """
12
+ Commands:
13
+ s3_website cfg SUBCOMMAND ...ARGS # Operate on the config file
14
+ s3_website help [COMMAND] # Describe available commands or one spe...
15
+ s3_website push # Push local files with the S3 website
16
+ """
17
+
18
+ @starts-new-os-process
19
+ Scenario: User wants to know what the push command does
20
+ When I run `s3_website help push`
21
+ Then the output should contain:
22
+ """
23
+ Usage:
24
+ s3_website push
25
+ """
26
+
27
+ @starts-new-os-process
28
+ Scenario: User wants to know what the cfg command does
29
+ When I run `s3_website cfg`
30
+ Then the output should contain:
31
+ """
32
+ Commands:
33
+ s3_website cfg apply # Apply the configuration on the AWS services
34
+ s3_website cfg create # Create a config file with placeholder values
35
+ s3_website cfg help [COMMAND] # Describe subcommands or one specific subco...
36
+ """
37
+
38
+ @starts-new-os-process
39
+ Scenario: User wants to know what the cfg apply command does
40
+ When I run `s3_website cfg help apply`
41
+ Then the output should contain:
42
+ """
43
+ Usage:
44
+ s3_website apply
45
+ """
46
+
47
+ @starts-new-os-process
48
+ Scenario: User wants to know what the cfg create command does
49
+ When I run `s3_website cfg help create`
50
+ Then the output should contain:
51
+ """
52
+ Usage:
53
+ s3_website create
54
+ """
@@ -0,0 +1,19 @@
1
+ Feature: remove an S3 website page from S3
2
+
3
+ In order to remove a webpage from S3
4
+ As a blogger
5
+ I want to run s3_website and see that my webpage was deleted from S3
6
+
7
+ @one-file-to-delete
8
+ Scenario: The user deletes a blog post
9
+ When my S3 website is in "features/support/test_site_dirs/unpublish-a-post.com"
10
+ And I call the push command
11
+ Then the output should equal
12
+ """
13
+ Deploying features/support/test_site_dirs/unpublish-a-post.com/_site/* to s3-website-test.net
14
+ Calculating diff ... done
15
+ No new or changed files to upload
16
+ Delete index.html: Success!
17
+ Done! Go visit: http://s3-website-test.net.s3-website-us-east-1.amazonaws.com/index.html
18
+
19
+ """
@@ -0,0 +1,24 @@
1
+ Feature: reporting errors to the user
2
+
3
+ Background: we want to show a non-technical error report to the user.
4
+ Consequently, we do not print the stack trace of the error.
5
+
6
+ @starts-new-os-process
7
+ @network-io
8
+ Scenario: The user calls "push" when the S3 credentials are invalid
9
+ When I run `s3_website push --site ../../features/support/test_site_dirs/my.blog.com --config_dir ../../features/support/test_site_dirs/my.blog.com`
10
+ Then the output should contain:
11
+ """
12
+ The AWS Access Key Id you provided does not exist in our records. (AWS::S3::Errors::InvalidAccessKeyId)
13
+ """
14
+ And the output should not contain:
15
+ """
16
+ throw
17
+ """
18
+ And the exit status should be 1
19
+
20
+ @starts-new-os-process
21
+ @network-io
22
+ Scenario: The user calls "cfg apply" when the S3 credentials are invalid
23
+ When I run `s3_website cfg apply`
24
+ And the exit status should be 1
@@ -0,0 +1,154 @@
1
+ Feature: Instructions for a new user
2
+
3
+ As a new s3_website user
4
+ I would like to get helpful feedback when running `s3_website`
5
+ So that I can upload my S3 website to S3 without headache
6
+
7
+ @starts-new-os-process
8
+ Scenario: Run s3_website in the wrong directory
9
+ When I run `s3_website push`
10
+ Then the output should contain:
11
+ """
12
+ I can't find a website in any of the following directories: public/output, _site. Please specify the location of the website with the --site option.
13
+ """
14
+
15
+ @starts-new-os-process
16
+ Scenario: Configuration is incomplete
17
+ When I run `s3_website push`
18
+ Then the exit status should be 1
19
+
20
+ @starts-new-os-process
21
+ Scenario: Create placeholder config file
22
+ Given a directory named "_site"
23
+ When I run `s3_website cfg create`
24
+ Then the output should contain:
25
+ """
26
+ I've just generated a file called s3_website.yml. Go put your details in it!
27
+ """
28
+ Then the file "s3_website.yml" should contain:
29
+ """
30
+ s3_id: YOUR_AWS_S3_ACCESS_KEY_ID
31
+ s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY
32
+ s3_bucket: your.blog.bucket.com
33
+ """
34
+
35
+ @starts-new-os-process
36
+ Scenario: Run s3_website push for the first time
37
+ Given a directory named "_site"
38
+ When I run `s3_website push`
39
+ Then the output should contain:
40
+ """
41
+ I've just generated a file called s3_website.yml. Go put your details in it!
42
+ """
43
+ Then the file "s3_website.yml" should contain:
44
+ """
45
+ s3_id: YOUR_AWS_S3_ACCESS_KEY_ID
46
+ s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY
47
+ s3_bucket: your.blog.bucket.com
48
+ """
49
+
50
+ @starts-new-os-process
51
+ Scenario: Run s3_website with an empty configuration file
52
+ Given a directory named "_site"
53
+ And an empty file named "s3_website.yml"
54
+ When I run `s3_website push`
55
+ Then the output should contain:
56
+ """
57
+ I can't parse the file s3_website.yml. It should look like this:
58
+ s3_id: YOUR_AWS_S3_ACCESS_KEY_ID
59
+ s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY
60
+ s3_bucket: your.blog.bucket.com
61
+ """
62
+
63
+ @starts-new-os-process
64
+ Scenario: The user wants to know the available configurations by looking at the cfg file
65
+ Given a directory named "_site"
66
+ When I run `s3_website push`
67
+ Then the file "s3_website.yml" should contain:
68
+ """
69
+ # max_age:
70
+ """
71
+ Then the file "s3_website.yml" should contain:
72
+ """
73
+ # gzip:
74
+ """
75
+ Then the file "s3_website.yml" should contain:
76
+ """
77
+ # s3_endpoint:
78
+ """
79
+ Then the file "s3_website.yml" should contain:
80
+ """
81
+ # ignore_on_server:
82
+ """
83
+ Then the file "s3_website.yml" should contain:
84
+ """
85
+ # s3_reduced_redundancy:
86
+ """
87
+ Then the file "s3_website.yml" should contain:
88
+ """
89
+ # cloudfront_distribution_id:
90
+ """
91
+ Then the file "s3_website.yml" should contain:
92
+ """
93
+ # cloudfront_distribution_config:
94
+ """
95
+ Then the file "s3_website.yml" should contain:
96
+ """
97
+ # redirects:
98
+ """
99
+ Then the file "s3_website.yml" should contain:
100
+ """
101
+ # routing_rules:
102
+ """
103
+ Then the file "s3_website.yml" should contain:
104
+ """
105
+ # concurrency_level:
106
+ """
107
+ Then the file "s3_website.yml" should contain:
108
+ """
109
+ # extensionless_mime_type: text/html
110
+ """
111
+
112
+ @starts-new-os-process
113
+ Scenario: Run s3_website with a malformed configuration file
114
+ Given a directory named "_site"
115
+ And a file named "s3_website.yml" with:
116
+ """
117
+ s3_id: YOUR_AWS_S3_ACCESS_KEY_ID
118
+ this is not yaml
119
+ """
120
+ When I run `s3_website push`
121
+ Then the output should contain:
122
+ """
123
+ I can't parse the file s3_website.yml. It should look like this:
124
+ s3_id: YOUR_AWS_S3_ACCESS_KEY_ID
125
+ s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY
126
+ s3_bucket: your.blog.bucket.com
127
+ """
128
+
129
+ @starts-new-os-process
130
+ Scenario: Run s3_website with a configuration file that does not contain a bucket
131
+ Given a directory named "_site"
132
+ And a file named "s3_website.yml" with:
133
+ """
134
+ s3_id: YOUR_AWS_S3_ACCESS_KEY_ID
135
+ s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY
136
+ s3_bucket:
137
+ """
138
+ When I run `s3_website push`
139
+ Then the output should contain:
140
+ """
141
+ I can't parse the file s3_website.yml. It should look like this:
142
+ s3_id: YOUR_AWS_S3_ACCESS_KEY_ID
143
+ s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY
144
+ s3_bucket: your.blog.bucket.com
145
+ """
146
+
147
+ @new-files
148
+ Scenario: Print the URL of the to the user
149
+ When my S3 website is in "features/support/test_site_dirs/my.blog.com"
150
+ And I call the push command
151
+ Then the output should contain
152
+ """
153
+ Go visit: http://s3-website-test.net.s3-website-us-east-1.amazonaws.com/index.html
154
+ """
@@ -0,0 +1,20 @@
1
+ Feature: upload a Jekyll site
2
+
3
+ @new-files
4
+ Scenario: Push a Jekyll site to S3
5
+ When my S3 website is in "features/support/test_site_dirs/jekyllrb.com"
6
+ And I call the push command
7
+ Then the output should contain
8
+ """
9
+ Deploying features/support/test_site_dirs/jekyllrb.com/_site/* to s3-website-test.net
10
+ Calculating diff ... done
11
+ Uploading 2 new file(s)
12
+ """
13
+ And the output should contain
14
+ """
15
+ Upload css/styles.css: Success!
16
+ """
17
+ And the output should contain
18
+ """
19
+ Upload index.html: Success!
20
+ """
@@ -0,0 +1,20 @@
1
+ Feature: upload a Nanoc site
2
+
3
+ @new-files
4
+ Scenario: Push a Nanoc site to S3
5
+ When my S3 website is in "features/support/test_site_dirs/nanoc.ws"
6
+ And I call the push command
7
+ Then the output should contain
8
+ """
9
+ Deploying features/support/test_site_dirs/nanoc.ws/public/output/* to s3-website-test.net
10
+ Calculating diff ... done
11
+ Uploading 2 new file(s)
12
+ """
13
+ And the output should contain
14
+ """
15
+ Upload css/styles.css: Success!
16
+ """
17
+ And the output should contain
18
+ """
19
+ Upload index.html: Success!
20
+ """