jekyll-s3 2.6.0 → 2.7.0
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.
- data/README.md +45 -9
- data/changelog.md +7 -0
- data/jekyll-s3.gemspec +1 -1
- data/lib/jekyll-s3/config_loader.rb +1 -1
- data/lib/jekyll-s3/uploader.rb +7 -3
- metadata +4 -4
data/README.md
CHANGED
@@ -31,6 +31,16 @@ s3_bucket: your.blog.bucket.com
|
|
31
31
|
|
32
32
|
* Run `jekyll-s3` to push your Jekyll blog to S3. Congratulations! You are live.
|
33
33
|
|
34
|
+
### Using environment variables
|
35
|
+
|
36
|
+
You can use ERB in your `_jekyll_s3.yml` file which incorporates environment variables:
|
37
|
+
|
38
|
+
```yaml
|
39
|
+
s3_id: <%= ENV['S3_ID'] %>
|
40
|
+
s3_secret: <%= ENV['S3_SECRET'] %>
|
41
|
+
s3_bucket: blog.example.com
|
42
|
+
```
|
43
|
+
|
34
44
|
## Additional features
|
35
45
|
|
36
46
|
### Cache Control
|
@@ -117,12 +127,32 @@ You can reduce the cost of hosting your blog on S3 by using Reduced Redundancy S
|
|
117
127
|
|
118
128
|
It is easy to deliver your S3-based web site via Cloudfront, the CDN of Amazon.
|
119
129
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
130
|
+
#### Creating a new CloudFront distribution
|
131
|
+
|
132
|
+
When you run the command `configure-s3-website`, it will ask you whether you
|
133
|
+
want to deliver your website via CloudFront. If you answer yes,
|
134
|
+
`configure-s3-website` will create a CloudFront distribution for you.
|
135
|
+
|
136
|
+
This feature was added into the version 1.3.0 of the `configure-s3-website` gem.
|
137
|
+
For more information, see the [gem's
|
138
|
+
documentation](https://github.com/laurilehmijoki/configure-s3-website).
|
139
|
+
|
140
|
+
#### Using your existing CloudFront distribution
|
141
|
+
|
142
|
+
If you already have a CloudFront distribution that serves data from your Jekyll
|
143
|
+
S3 bucket, just add the following line into the file `_jekyll_s3.yml`:
|
144
|
+
|
145
|
+
cloudfront_distribution_id: your-dist-id
|
146
|
+
|
147
|
+
Next time you run `jekyll-s3`, it will invalidate the items on CloudFront and
|
148
|
+
thus force the CDN system to reload the changes from your Jekyll S3 bucket.
|
149
|
+
|
150
|
+
#### Specifying custom settings for your CloudFront distribution
|
151
|
+
|
152
|
+
The gem `configure-s3-website`, which is a dependency of `jekyll-s3`, lets you
|
153
|
+
define custom settings for your CloudFront distribution. See the [gem's
|
154
|
+
documentation](https://github.com/laurilehmijoki/configure-s3-website) for more
|
155
|
+
info.
|
126
156
|
|
127
157
|
### The headless mode
|
128
158
|
|
@@ -139,7 +169,7 @@ Enable the headless mode by adding the `--headless` or `-h` argument after
|
|
139
169
|
You can set HTTP redirects on your Jekyll S3 website by adding the following
|
140
170
|
configuration into the `_jekyll_s3.yml` file:
|
141
171
|
|
142
|
-
|
172
|
+
```yaml
|
143
173
|
routing_rules:
|
144
174
|
- condition:
|
145
175
|
key_prefix_equals: blog/some_path
|
@@ -147,7 +177,11 @@ routing_rules:
|
|
147
177
|
host_name: blog.example.com
|
148
178
|
replace_key_prefix_with: some_new_path/
|
149
179
|
http_redirect_code: 301
|
150
|
-
|
180
|
+
```
|
181
|
+
|
182
|
+
After adding the configuration, run the command `configure-s3-website --config
|
183
|
+
_jekyll_s3.yml` on your command-line interface. This will apply the routing
|
184
|
+
rules on your S3 bucket.
|
151
185
|
|
152
186
|
For more information on configuring redirects, see the documentation of the
|
153
187
|
[configure-s3-website](https://github.com/laurilehmijoki/configure-s3-website#configuring-redirects)
|
@@ -170,7 +204,7 @@ You can also use a basic `Hash` instead of a `_jekyll_s3.yml` file:
|
|
170
204
|
config = {
|
171
205
|
"s3_id" => YOUR_AWS_S3_ACCESS_KEY_ID,
|
172
206
|
"s3_secret" => YOUR_AWS_S3_SECRET_ACCESS_KEY,
|
173
|
-
"s3_bucket" => your.blog.bucket.com
|
207
|
+
"s3_bucket" => "your.blog.bucket.com"
|
174
208
|
}
|
175
209
|
in_headless = true
|
176
210
|
Jekyll::S3::Uploader.run('/path/to/your/jekyll-site/_site/', config, in_headless)
|
@@ -223,6 +257,8 @@ Contributors (in alphabetical order)
|
|
223
257
|
* Cory Kaufman-Schofield
|
224
258
|
* Chris Kelly
|
225
259
|
* Chris Moos
|
260
|
+
* David Michael Barr
|
261
|
+
* László Bácsi
|
226
262
|
* Lauri Lehmijoki
|
227
263
|
* Mason Turner
|
228
264
|
* Michael Bleigh
|
data/changelog.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
This project uses [Semantic Versioning](http://semver.org).
|
4
4
|
|
5
|
+
## 2.7.0
|
6
|
+
|
7
|
+
* Allow s3_id and s3_secret to be omitted
|
8
|
+
|
9
|
+
This enables deploying jekyll-s3 on EC2 instances with IAM roles. The AWS SDK
|
10
|
+
will automatically fetch temporary credentials.
|
11
|
+
|
5
12
|
## 2.6.0
|
6
13
|
|
7
14
|
* Support configuring of redirects on the S3 website
|
data/jekyll-s3.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 = "jekyll-s3"
|
6
|
-
s.version = "2.
|
6
|
+
s.version = "2.7.0"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Philippe Creux", "Lauri Lehmijoki"]
|
9
9
|
s.email = ["pcreux@gmail.com", "lauri.lehmijoki@iki.fi"]
|
@@ -41,7 +41,7 @@ s3_bucket: your.blog.bucket.com
|
|
41
41
|
end
|
42
42
|
raise MalformedConfigurationFileError unless config
|
43
43
|
raise MalformedConfigurationFileError if
|
44
|
-
['
|
44
|
+
['s3_bucket'].any? { |key|
|
45
45
|
mandatory_config_value = config[key]
|
46
46
|
mandatory_config_value.nil? || mandatory_config_value == ''
|
47
47
|
}
|
data/lib/jekyll-s3/uploader.rb
CHANGED
@@ -4,9 +4,13 @@ module Jekyll
|
|
4
4
|
def self.run(site_dir, config, in_headless_mode = false)
|
5
5
|
puts "Deploying _site/* to #{config['s3_bucket']}"
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
s3_config = { :s3_endpoint => Endpoint.new(config['s3_endpoint']).hostname }
|
8
|
+
s3_id, s3_secret = config['s3_id'], config['s3_secret']
|
9
|
+
unless s3_id.nil? || s3_id == '' || s3_secret.nil? || s3_secret == ''
|
10
|
+
s3_config.merge! :access_key_id => s3_id, :secret_access_key => s3_secret
|
11
|
+
end
|
12
|
+
|
13
|
+
s3 = AWS::S3.new(s3_config)
|
10
14
|
|
11
15
|
new_files_count, changed_files_count, changed_files = upload_files(
|
12
16
|
s3, config, site_dir
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-05-
|
13
|
+
date: 2013-05-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: aws-sdk
|
@@ -337,7 +337,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
337
337
|
version: '0'
|
338
338
|
segments:
|
339
339
|
- 0
|
340
|
-
hash:
|
340
|
+
hash: 4368343528403061082
|
341
341
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
342
342
|
none: false
|
343
343
|
requirements:
|
@@ -346,7 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
346
346
|
version: '0'
|
347
347
|
segments:
|
348
348
|
- 0
|
349
|
-
hash:
|
349
|
+
hash: 4368343528403061082
|
350
350
|
requirements: []
|
351
351
|
rubyforge_project:
|
352
352
|
rubygems_version: 1.8.25
|