s3_website 1.6.4 → 1.6.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55cbf48ece87058d058773afa873397466a7bb46
4
- data.tar.gz: 23e1d2f8b50bad5582a3954fff956e5d401a4855
3
+ metadata.gz: f01a1cadbd9a8dcf5ff073f3b84ae1eca69d4fd3
4
+ data.tar.gz: 51193b4ace5ef371448d4378f67f0caa0ced7ff2
5
5
  SHA512:
6
- metadata.gz: e23239516c9d32cf5a29bc826a5809635e17e20adfd8aa083a620e6ca9aa2ad8e8da29d467c2aeebe5732ea7516bd1f3a6024551739c85fe59ae13199fa3ad84
7
- data.tar.gz: f6857264ecd3e9f88b92979c55d89a54800a14d2f07b325dce5871edc8eb5e6aeb4720c50d685dcdacbde379c3a3d3a76e707f2c01145e3539d5ea6ac5fe0f97
6
+ metadata.gz: b7943e03d17a5a5291eed51841434fb01d9fcdaa9e0d5e3dd87a697c2460060d209681f7a2c03df7a0a75dbc563365f3e9257d760921362575597c57160c825e
7
+ data.tar.gz: b5b10a4c5d399ec341e7f1051d652a85991f93aeb5ede93ce2fa360a4e62857b4158877777ffdb1deab34b1a5d82f37cba60986eb2bcb60d8dacbd8b2533cee9
data/.travis.yml CHANGED
@@ -2,3 +2,4 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
+ - 2.1.0
data/README.md CHANGED
@@ -24,7 +24,8 @@
24
24
 
25
25
  Here's how you can get started:
26
26
 
27
- * In [AWS IAM](https://console.aws.amazon.com/iam), create API credentials that have sufficient permissions to S3
27
+ * Create API credentials that have sufficient permissions to S3. More info
28
+ [here](https://github.com/laurilehmijoki/s3_website/blob/master/additional-docs/setting-up-aws-credentials.md).
28
29
  * Go to your website directory
29
30
  * Run `s3_website cfg create`. This generates a configuration file called `s3_website.yml`.
30
31
  * Put your AWS credentials and the S3 bucket name into the file
@@ -263,7 +264,7 @@ No more index.htmls in your URLs!
263
264
 
264
265
  *Note*: If the root resource on your folder displays an error instead of the
265
266
  index file, your source bucket in Cloudfront likely is pointing to the S3 Origin,
266
- *example.com.s3.amazonaws.com*. Update the source to the S3 Website Endpoint,
267
+ *example.com.s3.amazonaws.com*. Update the source to the S3 Website Endpoint,
267
268
  *e.g. example.com.s3-website-us-east-1.amazonaws.com*, to fix this.
268
269
 
269
270
  ### The headless mode
@@ -371,7 +372,7 @@ maximum open files (on Unix-like systems, see `man ulimit`) or decrease the
371
372
  ## Example configurations
372
373
 
373
374
  See
374
- <https://github.com/laurilehmijoki/s3_website/blob/master/example-configurations.md>.
375
+ <https://github.com/laurilehmijoki/s3_website/blob/master/additional-docs/example-configurations.md>.
375
376
 
376
377
  ## Known issues
377
378
 
@@ -383,6 +384,10 @@ Please create an issue and send a pull request if you spot any.
383
384
 
384
385
  s3_website uses [Semantic Versioning](http://semver.org).
385
386
 
387
+ In the spirit of semantic versioning, here is the definition of public API for
388
+ s3_website: Within a major version, s3_website will not break
389
+ backwards-compatibility of anything that is mentioned in this README file.
390
+
386
391
  ### Tests
387
392
 
388
393
  * Install bundler and run `bundle install`
@@ -37,7 +37,6 @@ cloudfront_distribution_config:
37
37
  CNAME: your.domain.net
38
38
  max_age: 120
39
39
  gzip: true
40
- concurrency_level: 100
41
40
  ````
42
41
 
43
42
  Above, we store the AWS credentials and the id of the CloudFront distribution as
@@ -0,0 +1,51 @@
1
+ # Setting up AWS credentials
2
+
3
+ Before starting to use s3\_website, you need to create AWS credentials.
4
+
5
+ ## Easy setup
6
+
7
+ * Go to [AWS IAM console](https://console.aws.amazon.com/iam)
8
+ * Create a new user that has full permissions to the S3 and CloudFront services
9
+ * Call `s3_website cfg create` and place the credentials of your new AWS user
10
+ into the *s3_website.yml* file
11
+ * Read the main documentation for further info
12
+
13
+ ## Limiting the permissions of the credentials
14
+
15
+ AWS IAM offers multiple ways of limiting the permissions of a user. Below is one
16
+ way of configuring the limitations and yet retaining the capability to use all
17
+ s3\_website features.
18
+
19
+ If you know the hostname of your public website (say `my.website.com`), perform the
20
+ following steps:
21
+
22
+ * Create a user that has full permissions to the S3 bucket
23
+ * In addition, let the user have full permissions to CloudFront
24
+
25
+ Here is the IAM Policy Document of the above setup:
26
+
27
+ ```json
28
+ {
29
+ "Statement": [
30
+ {
31
+ "Action": [
32
+ "cloudfront:*"
33
+ ],
34
+ "Effect": "Allow",
35
+ "Resource": [
36
+ "*"
37
+ ]
38
+ },
39
+ {
40
+ "Action": [
41
+ "s3:*"
42
+ ],
43
+ "Effect": "Allow",
44
+ "Resource": [
45
+ "arn:aws:s3:::my.website.com",
46
+ "arn:aws:s3:::my.website.com/*"
47
+ ]
48
+ }
49
+ ]
50
+ }
51
+ ```
data/bin/s3_website CHANGED
@@ -8,6 +8,7 @@ class Cfg < Thor
8
8
  S3Website::Tasks.config_create Dir.pwd
9
9
  rescue Exception => e
10
10
  puts S3Website.error_report e
11
+ exit 1
11
12
  end
12
13
 
13
14
  desc 'apply', 'Apply the configuration on the AWS services'
@@ -28,6 +29,7 @@ class Cfg < Thor
28
29
  })
29
30
  rescue Exception => e
30
31
  puts S3Website.error_report e
32
+ exit 1
31
33
  end
32
34
  end
33
35
 
@@ -60,6 +62,7 @@ class Cli < Thor
60
62
  S3Website::Tasks.push(options[:config_dir], site_path, options[:headless])
61
63
  rescue Exception => e
62
64
  puts S3Website.error_report e
65
+ exit 1
63
66
  end
64
67
 
65
68
  desc 'cfg SUBCOMMAND ...ARGS', 'Operate on the config file'
data/changelog.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This project uses [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## 1.6.5
6
+
7
+ * In case of error, exit with status 1
8
+
5
9
  ## 1.6.4
6
10
 
7
11
  * Add systematic error handling
@@ -7,23 +7,23 @@ Feature: Using s3_website as a library
7
7
  @one-file-to-delete
8
8
  Scenario: Developer wants feedback on how many files s3_website deleted
9
9
  When my S3 website is in "features/support/test_site_dirs/unpublish-a-post.com"
10
- Then s3_website will push my blog to S3
11
- And report that it deleted 1 file from S3
10
+ And I call the push command
11
+ Then s3_website should report that it deleted 1 file from S3
12
12
 
13
13
  @new-and-changed-files
14
14
  Scenario: Developer wants feedback on how many files s3_website uploaded
15
15
  When my S3 website is in "features/support/test_site_dirs/new-and-changed-files.com"
16
- Then s3_website will push my blog to S3
17
- And report that it uploaded 1 new and 1 changed files into S3
16
+ And I call the push command
17
+ Then s3_website should report that it uploaded 1 new and 1 changed files into S3
18
18
 
19
19
  @s3-and-cloudfront-when-updating-a-file
20
20
  Scenario: Developer wants feedback on how many Cloudfront items s3_website invalidated
21
21
  When my S3 website is in "features/support/test_site_dirs/cdn-powered.with-one-change.blog.fi"
22
- Then s3_website will push my blog to S3 and invalidate the Cloudfront distribution
23
- And report that it invalidated 2 Cloudfront item
22
+ And I call the push command
23
+ Then s3_website should report that it invalidated 2 Cloudfront item
24
24
 
25
25
  @create-redirect
26
26
  Scenario: Developer wants feedback on how many redirects s3_website created
27
27
  When my S3 website is in "features/support/test_site_dirs/create-redirects"
28
- Then s3_website will push my blog to S3
29
- And report that it created 2 new redirects
28
+ And I call the push command
29
+ Then s3_website should report that it created 2 new redirects
@@ -9,8 +9,8 @@ Feature: Invalidate the Cloudfront distribution
9
9
  @s3-and-cloudfront
10
10
  Scenario: Upload to S3 and then invalidate the Cloudfront distribution
11
11
  When my S3 website is in "features/support/test_site_dirs/cdn-powered.blog.fi"
12
- Then s3_website will push my blog to S3 and invalidate the Cloudfront distribution
13
- And the output should contain
12
+ And I call the push command
13
+ Then the output should contain
14
14
  """
15
15
  Invalidating Cloudfront items...
16
16
  /
@@ -20,8 +20,8 @@ Feature: Invalidate the Cloudfront distribution
20
20
  @s3-and-cloudfront-when-updating-a-file
21
21
  Scenario: Update a blog entry and then upload
22
22
  When my S3 website is in "features/support/test_site_dirs/cdn-powered.with-one-change.blog.fi"
23
- Then s3_website will push my blog to S3 and invalidate the Cloudfront distribution
24
- And the output should equal
23
+ And I call the push command
24
+ Then the output should equal
25
25
  """
26
26
  Deploying features/support/test_site_dirs/cdn-powered.with-one-change.blog.fi/_site/* to s3-website-test.net
27
27
  Calculating diff ... done
@@ -38,8 +38,8 @@ Feature: Invalidate the Cloudfront distribution
38
38
  @s3-and-cloudfront-after-deleting-a-file
39
39
  Scenario: Delete a blog post and then push the website
40
40
  When my S3 website is in "features/support/test_site_dirs/cdn-powered.when-deleted-a-file.blog.fi"
41
- Then s3_website will push my blog to S3 and invalidate the Cloudfront distribution
42
- And the output should equal
41
+ And I call the push command
42
+ Then the output should equal
43
43
  """
44
44
  Deploying features/support/test_site_dirs/cdn-powered.when-deleted-a-file.blog.fi/_site/* to s3-website-test.net
45
45
  Calculating diff ... done
@@ -7,8 +7,8 @@ Feature: remove an S3 website page from S3
7
7
  @one-file-to-delete
8
8
  Scenario: The user deletes a blog post
9
9
  When my S3 website is in "features/support/test_site_dirs/unpublish-a-post.com"
10
- Then s3_website will push my blog to S3
11
- And the output should equal
10
+ And I call the push command
11
+ Then the output should equal
12
12
  """
13
13
  Deploying features/support/test_site_dirs/unpublish-a-post.com/_site/* to s3-website-test.net
14
14
  Calculating diff ... done
@@ -5,7 +5,7 @@ Feature: reporting errors to the user
5
5
 
6
6
  @starts-new-os-process
7
7
  @network-io
8
- Scenario: The S3 credentials are invalid
8
+ Scenario: The user calls "push" when the S3 credentials are invalid
9
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
10
  Then the output should contain:
11
11
  """
@@ -15,3 +15,10 @@ Feature: reporting errors to the user
15
15
  """
16
16
  throw
17
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
@@ -12,6 +12,11 @@ Feature: Instructions for a new user
12
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
13
  """
14
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
+
15
20
  @starts-new-os-process
16
21
  Scenario: Create placeholder config file
17
22
  Given a directory named "_site"
@@ -142,8 +147,8 @@ Feature: Instructions for a new user
142
147
  @new-files
143
148
  Scenario: Print the URL of the to the user
144
149
  When my S3 website is in "features/support/test_site_dirs/my.blog.com"
145
- Then s3_website will push my blog to S3
146
- And the output should contain
150
+ And I call the push command
151
+ Then the output should contain
147
152
  """
148
153
  Go visit: http://s3-website-test.net.s3-website-us-east-1.amazonaws.com/index.html
149
154
  """
@@ -3,8 +3,8 @@ Feature: upload a Jekyll site
3
3
  @new-files
4
4
  Scenario: Push a Jekyll site to S3
5
5
  When my S3 website is in "features/support/test_site_dirs/jekyllrb.com"
6
- Then s3_website will push my blog to S3
7
- And the output should contain
6
+ And I call the push command
7
+ Then the output should contain
8
8
  """
9
9
  Deploying features/support/test_site_dirs/jekyllrb.com/_site/* to s3-website-test.net
10
10
  Calculating diff ... done
@@ -3,8 +3,8 @@ Feature: upload a Nanoc site
3
3
  @new-files
4
4
  Scenario: Push a Nanoc site to S3
5
5
  When my S3 website is in "features/support/test_site_dirs/nanoc.ws"
6
- Then s3_website will push my blog to S3
7
- And the output should contain
6
+ And I call the push command
7
+ Then the output should contain
8
8
  """
9
9
  Deploying features/support/test_site_dirs/nanoc.ws/public/output/* to s3-website-test.net
10
10
  Calculating diff ... done
@@ -7,8 +7,8 @@ Feature: upload S3 website to S3
7
7
  @new-files
8
8
  Scenario: Push a new S3 website to S3
9
9
  When my S3 website is in "features/support/test_site_dirs/my.blog.com"
10
- Then s3_website will push my blog to S3
11
- And the output should contain
10
+ And I call the push command
11
+ Then the output should contain
12
12
  """
13
13
  Deploying features/support/test_site_dirs/my.blog.com/_site/* to s3-website-test.net
14
14
  Calculating diff ... done
@@ -43,8 +43,8 @@ Feature: upload S3 website to S3
43
43
  @new-files-for-sydney
44
44
  Scenario: Push a new S3 website to an S3 bucket in Sydney
45
45
  When my S3 website is in "features/support/test_site_dirs/my.sydney.blog.au"
46
- Then s3_website will push my blog to S3
47
- And the output should contain
46
+ And I call the push command
47
+ Then the output should contain
48
48
  """
49
49
  Done! Go visit: http://s3-website-test.net.s3-website-ap-southeast-2.amazonaws.com/index.html
50
50
  """
@@ -52,8 +52,8 @@ Feature: upload S3 website to S3
52
52
  @new-and-changed-files
53
53
  Scenario: Upload a new blog post and change an old post
54
54
  When my S3 website is in "features/support/test_site_dirs/new-and-changed-files.com"
55
- Then s3_website will push my blog to S3
56
- And the output should contain
55
+ And I call the push command
56
+ Then the output should contain
57
57
  """
58
58
  Deploying features/support/test_site_dirs/new-and-changed-files.com/_site/* to s3-website-test.net
59
59
  Calculating diff ... done
@@ -76,8 +76,8 @@ Feature: upload S3 website to S3
76
76
  @only-changed-files
77
77
  Scenario: Update an existing blog post
78
78
  When my S3 website is in "features/support/test_site_dirs/only-changed-files.com"
79
- Then s3_website will push my blog to S3
80
- And the output should equal
79
+ And I call the push command
80
+ Then the output should equal
81
81
  """
82
82
  Deploying features/support/test_site_dirs/only-changed-files.com/_site/* to s3-website-test.net
83
83
  Calculating diff ... done
@@ -90,8 +90,8 @@ Feature: upload S3 website to S3
90
90
  @no-new-or-changed-files
91
91
  Scenario: The user runs s3_website even though he doesn't have new or changed posts
92
92
  When my S3 website is in "features/support/test_site_dirs/no-new-or-changed-files.com"
93
- Then s3_website will push my blog to S3
94
- And the output should equal
93
+ And I call the push command
94
+ Then the output should equal
95
95
  """
96
96
  Deploying features/support/test_site_dirs/no-new-or-changed-files.com/_site/* to s3-website-test.net
97
97
  Calculating diff ... done
@@ -103,8 +103,8 @@ Feature: upload S3 website to S3
103
103
  @new-and-changed-files
104
104
  Scenario: The blogger user does not want to upload certain files
105
105
  When my S3 website is in "features/support/test_site_dirs/ignored-files.com"
106
- Then s3_website will push my blog to S3
107
- And the output should equal
106
+ And I call the push command
107
+ Then the output should equal
108
108
  """
109
109
  Deploying features/support/test_site_dirs/ignored-files.com/_site/* to s3-website-test.net
110
110
  Calculating diff ... done
@@ -3,8 +3,8 @@ Feature: configure redirects
3
3
  @create-redirect
4
4
  Scenario: The user wants to configure new redirects for HTTP resources
5
5
  When my S3 website is in "features/support/test_site_dirs/create-redirects"
6
- Then s3_website will push my blog to S3
7
- And the output should contain
6
+ And I call the push command
7
+ Then the output should contain
8
8
  """
9
9
  Creating new redirects ...
10
10
  Redirect welcome.php to /welcome: Success!
@@ -3,8 +3,8 @@ Feature: Security
3
3
  @empty-bucket
4
4
  Scenario: The user does not want to upload the s3_website.yml file
5
5
  When my S3 website is in "features/support/test_site_dirs/site-that-contains-s3-website-file.com"
6
- Then s3_website will push my blog to S3
7
- And the output should not contain "s3_website.yml"
6
+ And I call the push command
7
+ Then the output should not contain "s3_website.yml"
8
8
  And the output should equal
9
9
  """
10
10
  Deploying features/support/test_site_dirs/site-that-contains-s3-website-file.com/_site/* to another-s3-website-test.net
@@ -4,11 +4,7 @@ When /^my S3 website is in "(.*?)"$/ do |blog_dir|
4
4
  @blog_dir = blog_dir
5
5
  end
6
6
 
7
- When /^s3_website will push my blog to S3$/ do
8
- push_files
9
- end
10
-
11
- Then /^s3_website will push my blog to S(\d+) and invalidate the Cloudfront distribution$/ do |args|
7
+ When /^I call the push command$/ do
12
8
  push_files
13
9
  end
14
10
 
@@ -20,21 +16,21 @@ Then /^the output should contain$/ do |expected_console_output|
20
16
  @console_output.should include(expected_console_output)
21
17
  end
22
18
 
23
- Then /^report that it uploaded (\d+) new and (\d+) changed files into S3$/ do
19
+ Then /^s3_website should report that it uploaded (\d+) new and (\d+) changed files into S3$/ do
24
20
  |new_count, changed_count|
25
21
  @amount_of_new_files.should == new_count.to_i
26
22
  @amount_of_changed_files.should == changed_count.to_i
27
23
  end
28
24
 
29
- Then /^report that it invalidated (\d+) Cloudfront item$/ do |expected|
25
+ Then /^s3_website should report that it invalidated (\d+) Cloudfront item$/ do |expected|
30
26
  @amount_of_invalidated_items.should == expected.to_i
31
27
  end
32
28
 
33
- Then /^report that it created (\d+) new redirects$/ do |expected|
29
+ Then /^s3_website should report that it created (\d+) new redirects$/ do |expected|
34
30
  @amount_of_new_redirects.should == expected.to_i
35
31
  end
36
32
 
37
- Then /^report that it deleted (\d+) file from S3$/ do |amount_of_deleted_files|
33
+ Then /^s3_website should report that it deleted (\d+) file from S3$/ do |amount_of_deleted_files|
38
34
  @amount_of_deleted_files.should == amount_of_deleted_files.to_i
39
35
  end
40
36
 
@@ -7,8 +7,8 @@ Feature: improve response times of your S3 website website
7
7
  @new-files
8
8
  Scenario: Set Cache-Control: max-age for all uploaded files
9
9
  When my S3 website is in "features/support/test_site_dirs/site.with.maxage.com"
10
- Then s3_website will push my blog to S3
11
- And the output should contain
10
+ And I call the push command
11
+ Then the output should contain
12
12
  """
13
13
  Upload css/styles.css [max-age=120]: Success!
14
14
  """
@@ -20,8 +20,8 @@ Feature: improve response times of your S3 website website
20
20
  @new-files
21
21
  Scenario: Set Cache-Control: max-age for CSS files only
22
22
  When my S3 website is in "features/support/test_site_dirs/site.with.css-maxage.com"
23
- Then s3_website will push my blog to S3
24
- And the output should contain
23
+ And I call the push command
24
+ Then the output should contain
25
25
  """
26
26
  Upload css/styles.css [max-age=100]: Success!
27
27
  """
@@ -33,8 +33,8 @@ Feature: improve response times of your S3 website website
33
33
  @new-files
34
34
  Scenario: Set Content-Encoding: gzip HTTP header for HTML files
35
35
  When my S3 website is in "features/support/test_site_dirs/site.with.gzipped-html.com"
36
- Then s3_website will push my blog to S3
37
- And the output should contain
36
+ And I call the push command
37
+ Then the output should contain
38
38
  """
39
39
  Upload css/styles.css: Success!
40
40
  """
@@ -46,8 +46,8 @@ Feature: improve response times of your S3 website website
46
46
  @new-files
47
47
  Scenario: Set both the Content-Encoding: gzip and Cache-Control: max-age headers
48
48
  When my S3 website is in "features/support/test_site_dirs/site.with.gzipped-and-max-aged-content.com"
49
- Then s3_website will push my blog to S3
50
- And the output should contain
49
+ And I call the push command
50
+ Then the output should contain
51
51
  """
52
52
  Upload css/styles.css [gzipped] [max-age=300]: Success!
53
53
  """
data/s3_website.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "s3_website"
6
- s.version = "1.6.4"
6
+ s.version = "1.6.5"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Lauri Lehmijoki"]
9
9
  s.email = ["lauri.lehmijoki@iki.fi"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_website
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.4
4
+ version: 1.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lauri Lehmijoki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-06 00:00:00.000000000 Z
11
+ date: 2014-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -221,9 +221,10 @@ files:
221
221
  - LICENSE
222
222
  - README.md
223
223
  - Rakefile
224
+ - additional-docs/example-configurations.md
225
+ - additional-docs/setting-up-aws-credentials.md
224
226
  - bin/s3_website
225
227
  - changelog.md
226
- - example-configurations.md
227
228
  - features/as-library.feature
228
229
  - features/cassettes/cucumber_tags/create-redirect.yml
229
230
  - features/cassettes/cucumber_tags/empty-bucket.yml