cloudformation-tool 1.5.15 → 1.5.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloud_formation_tool/storable.rb +11 -3
- data/lib/cloud_formation_tool/version.rb +1 -1
- data/lib/cloud_formation_tool.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cda5830569bb0452c460ca5751f58071594e3a8752662676364a8c7360035dff
|
4
|
+
data.tar.gz: 1677f34f4acdc68bf0e7b7870e39f56d8efa351e2d734364ca69ff5c9c74780c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd0fc20ae3e89881114581d638b304b137fc9064d362cf6746143df6931db2a91e95898a20ece7061c07ca78d963f279186c1f17012bcef7672612e1b14700bb
|
7
|
+
data.tar.gz: f22e1e4ffb42bfbfb043625c291ab997b0e8fae5adbffa327160dd4400390837b65e57d57859f6b7c0b849ae3c3a5b9f1873bf99343ae4b90bb66b13d6c6adcd
|
@@ -15,12 +15,15 @@ module CloudFormationTool
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def cached_object(md5)
|
18
|
-
Aws::S3::Bucket.new(s3_bucket_name(region), client: awss3(region)).objects(prefix:
|
18
|
+
Aws::S3::Bucket.new(s3_bucket_name(region), client: awss3(region)).objects(prefix: prefix(md5)).first
|
19
|
+
end
|
20
|
+
|
21
|
+
def prefix(md5)
|
22
|
+
"cf-compiled/#{md5[0]}/#{md5[1..2]}/#{md5}/"
|
19
23
|
end
|
20
24
|
|
21
25
|
def upload(path, content, mime_type: 'text/yaml', gzip: true)
|
22
26
|
md5 = Digest::MD5.hexdigest content
|
23
|
-
prefix = "#{md5[0]}/#{md5[1..2]}/#{md5}"
|
24
27
|
b = Aws::S3::Bucket.new(s3_bucket_name(region), client: awss3(region))
|
25
28
|
# return early if we already have a copy of this object stored.
|
26
29
|
# if this object was previously uploaded, we use its URLs (and not, for example,
|
@@ -30,7 +33,7 @@ module CloudFormationTool
|
|
30
33
|
o = cached_object(md5)
|
31
34
|
if o.nil?
|
32
35
|
# no such luck, we need to actually upload the file
|
33
|
-
o = b.object(
|
36
|
+
o = b.object(prefix(md5) + path)
|
34
37
|
file_opts = {
|
35
38
|
acl: 'public-read',
|
36
39
|
body: content,
|
@@ -38,6 +41,11 @@ module CloudFormationTool
|
|
38
41
|
content_type: mime_type,
|
39
42
|
storage_class: 'REDUCED_REDUNDANCY'
|
40
43
|
}
|
44
|
+
ownctl = b.client.get_bucket_ownership_controls(bucket: b.name).ownership_controls
|
45
|
+
if ownctl.rules.first.object_ownership == 'BucketOwnerEnforced' then
|
46
|
+
# no point in setting ACL
|
47
|
+
file_opts.delete :acl
|
48
|
+
end
|
41
49
|
file_opts.merge!({content_encoding: 'gzip'}) if gzip
|
42
50
|
debug "Uploading S3 object s3://#{b.name}/#{o.key}"
|
43
51
|
o.put(file_opts)
|
data/lib/cloud_formation_tool.rb
CHANGED
@@ -15,7 +15,7 @@ def log(message = nil, &block)
|
|
15
15
|
end)
|
16
16
|
end
|
17
17
|
|
18
|
-
def debug(message =
|
18
|
+
def debug(message = nil, &block)
|
19
19
|
logger.debug(if message.nil?
|
20
20
|
yield
|
21
21
|
else
|
@@ -23,7 +23,7 @@ def debug(message = nul, &block)
|
|
23
23
|
end)
|
24
24
|
end
|
25
25
|
|
26
|
-
def warn(message =
|
26
|
+
def warn(message = nil, &block)
|
27
27
|
logger.warn(if message.nil?
|
28
28
|
yield
|
29
29
|
else
|
@@ -31,7 +31,7 @@ def warn(message = nul, &block)
|
|
31
31
|
end)
|
32
32
|
end
|
33
33
|
|
34
|
-
def error(message =
|
34
|
+
def error(message = nil, &block)
|
35
35
|
logger.error(if message.nil?
|
36
36
|
yield
|
37
37
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudformation-tool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oded Arbel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
222
|
- !ruby/object:Gem::Version
|
223
223
|
version: '0'
|
224
224
|
requirements: []
|
225
|
-
rubygems_version: 3.
|
225
|
+
rubygems_version: 3.4.20
|
226
226
|
signing_key:
|
227
227
|
specification_version: 4
|
228
228
|
summary: A pre-compiler tool for CloudFormation YAML templates
|