cloudformation-tool 1.5.15 → 1.5.16
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 +4 -4
- data/lib/cloud_formation_tool/storable.rb +11 -3
- data/lib/cloud_formation_tool/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e8d4a5cbf8e7c4507df05dc594406e66b3cb4ee6b0879dbec0b5773a0b560da
|
4
|
+
data.tar.gz: 4ecf077524e906ccf844b83afe9e19d98ba1a41d223987c0cc3fdb3a96fea3ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a10a4d380dbab3d0e3c152fae9877d66872fa1cda68c493826342a59a629b4bc325dfd6abc6cd24e0c64b5064d10d60edba683152e6c0517c5587a6fe1e8010
|
7
|
+
data.tar.gz: ea96dc4874e8a2e8564927ec5c335a3077c2e3ea9417f170aa8f20f17f91b6c2e0bbee69091783a7a6b81a13a76be1e467d6718a247f33f6ff12926ac3c6479a
|
@@ -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)
|
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.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oded Arbel
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -164,7 +164,7 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
-
description:
|
167
|
+
description:
|
168
168
|
email: oded.arbel@greenfieldtech.net
|
169
169
|
executables:
|
170
170
|
- cftool
|
@@ -207,7 +207,7 @@ homepage: http://github.com/GreenfieldTech/cloudformation-tool
|
|
207
207
|
licenses:
|
208
208
|
- GPL-2.0
|
209
209
|
metadata: {}
|
210
|
-
post_install_message:
|
210
|
+
post_install_message:
|
211
211
|
rdoc_options: []
|
212
212
|
require_paths:
|
213
213
|
- lib
|
@@ -222,8 +222,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
222
|
- !ruby/object:Gem::Version
|
223
223
|
version: '0'
|
224
224
|
requirements: []
|
225
|
-
rubygems_version: 3.3.
|
226
|
-
signing_key:
|
225
|
+
rubygems_version: 3.3.5
|
226
|
+
signing_key:
|
227
227
|
specification_version: 4
|
228
228
|
summary: A pre-compiler tool for CloudFormation YAML templates
|
229
229
|
test_files: []
|