Permalink
Browse files

updated gem to enable the user to specify an S3 endpoint

The jekyll-s3 config file should include the 's3_endpoint' directive.
See http://docs.amazonwebservices.com/general/latest/gr/rande.html#s3_region
for a list of endpoints.
  • Loading branch information...
borrell committed Oct 28, 2012
1 parent faccda0 commit 0f639d2231ffc75c17712ea62adff2b4c8ef93fd
Showing with 8 additions and 4 deletions.
  1. +2 −2 lib/jekyll-s3/cli.rb
  2. +3 −1 lib/jekyll-s3/config_loader.rb
  3. +3 −1 lib/jekyll-s3/uploader.rb
@@ -9,10 +9,10 @@ def self.run
def run(site_dir)
CLI.check_configuration site_dir
s3_id, s3_secret, s3_bucket, cloudfront_distribution_id =
s3_id, s3_secret, s3_bucket, s3_endpoint, cloudfront_distribution_id =
Jekyll::S3::ConfigLoader.load_configuration site_dir
amount_of_uploaded_files =
Uploader.run(site_dir, s3_id, s3_secret, s3_bucket)
Uploader.run(site_dir, s3_id, s3_secret, s3_bucket, s3_endpoint)
CLI.invalidate_cf_dist_if_configured s3_id, s3_secret, s3_bucket, cloudfront_distribution_id
amount_of_uploaded_files
rescue JekyllS3Error => e
@@ -6,6 +6,7 @@ class ConfigLoader
s3_id: YOUR_AWS_S3_ACCESS_KEY_ID
s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY
s3_bucket: your.blog.bucket.com
s3_endpoint: s3.amazonaws.com
cloudfront_distribution_id: YOUR_CLOUDFRONT_DIST_ID (OPTIONAL)
EOF
@@ -30,11 +31,12 @@ def self.load_configuration(site_dir)
s3_id = config['s3_id']
s3_secret = config['s3_secret']
s3_bucket = config['s3_bucket']
s3_endpoint = config['s3_endpoint']
cloudfront_distribution_id = config['cloudfront_distribution_id']
raise MalformedConfigurationFileError unless
[s3_id, s3_secret, s3_bucket].select { |k| k.nil? || k == '' }.empty?
return s3_id, s3_secret, s3_bucket, cloudfront_distribution_id
return s3_id, s3_secret, s3_bucket, s3_endpoint, cloudfront_distribution_id
end
def self.create_template_configuration_file(site_dir)
@@ -1,9 +1,11 @@
module Jekyll
module S3
class Uploader
def self.run(site_dir, s3_id, s3_secret, s3_bucket_name)
def self.run(site_dir, s3_id, s3_secret, s3_bucket_name, s3_endpoint)
puts "Deploying _site/* to #{s3_bucket_name}"
AWS.config(:s3_endpoint => s3_endpoint)
s3 = AWS::S3.new(:access_key_id => s3_id,
:secret_access_key => s3_secret)

0 comments on commit 0f639d2

Please sign in to comment.