middleman-s3_sync 3.0.44 → 3.0.45

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41a91ccc1a953b5a05bb8ff2661a78d8d24a2e2c
4
- data.tar.gz: 09d8221d166c4e5083c3efb90a6c30254a7224b4
3
+ metadata.gz: 10ed99e03229c37d05e89b9d54f7ca3fa5ed9c61
4
+ data.tar.gz: bc853f7697f4288928a281b208fd348f47135f76
5
5
  SHA512:
6
- metadata.gz: 8f3573a6f4c23e70b97d22abab4d7394ada0db11728ff9589f99842d13337807f8dd8f22c16f940fd6a3e1056aea1186d1972625f4dfe02d2e29cb8e79a9fe2b
7
- data.tar.gz: ca74baff13092646c65701dbdd609158136638f0345eb1dbe990f263bdd1135814a0b39c5881f492d09031b194b527def221c811b369846640ec6d5942166093
6
+ metadata.gz: 52ccf37f0217581071d908e9010fd9d3ccfa20e19b12dcfbf4d4c6547d6bb224910103ff1dcbc12e8c1288212b727c8d5820dc01c8a595e44bf406e1bd09d777
7
+ data.tar.gz: 403f0678c256ae11d43028093ce7d82c842d5a82312432fc198c11c3026ab6fe27743678d954abca200aa7d67102220875d79356a5f7feecd9de60ae5d91a093
data/README.md CHANGED
@@ -117,6 +117,10 @@ map to the following values:
117
117
  The environment is used when the credentials are not set in the activate
118
118
  method or passed through the ```.s3_sync``` configuration file.
119
119
 
120
+ #### Through IAM role
121
+
122
+ Alternatively, if you are running builds on EC2 instance which has approrpiate IAM role, then you don't need to think about specifying credentials at all – they will be pulled from AWS metadata server.
123
+
120
124
  ### IAM Policy
121
125
 
122
126
  Here's a sample IAM policy that will allow a user to update the site
@@ -58,12 +58,22 @@ module Middleman
58
58
  end
59
59
 
60
60
  def connection
61
- @connection ||= Fog::Storage::AWS.new({
62
- :aws_access_key_id => s3_sync_options.aws_access_key_id,
63
- :aws_secret_access_key => s3_sync_options.aws_secret_access_key,
61
+
62
+ connection_options = {
64
63
  :region => s3_sync_options.region,
65
64
  :path_style => s3_sync_options.path_style
66
- })
65
+ }
66
+
67
+ if s3_sync_options.aws_access_key_id && s3_sync_options.aws_secret_access_key
68
+ connection_options.merge!({
69
+ :aws_access_key_id => s3_sync_options.aws_access_key_id,
70
+ :aws_secret_access_key => s3_sync_options.aws_secret_access_key
71
+ })
72
+ else
73
+ connection_options.merge!({ :use_iam_profile => true })
74
+ end
75
+
76
+ @connection ||= Fog::Storage::AWS.new(connection_options)
67
77
  end
68
78
 
69
79
  def resources
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module S3Sync
3
- VERSION = "3.0.44"
3
+ VERSION = "3.0.45"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-s3_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.44
4
+ version: 3.0.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederic Jean
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-14 00:00:00.000000000 Z
12
+ date: 2015-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core