cloudformation-tool 1.5.16 → 1.5.18

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
  SHA256:
3
- metadata.gz: 3e8d4a5cbf8e7c4507df05dc594406e66b3cb4ee6b0879dbec0b5773a0b560da
4
- data.tar.gz: 4ecf077524e906ccf844b83afe9e19d98ba1a41d223987c0cc3fdb3a96fea3ac
3
+ metadata.gz: c1867f7dfd75baca9665346189538e0e163dc02fed289c86c0bb5cf4f1a4ef0b
4
+ data.tar.gz: 273b829da8d9028c11c4e12a5b62450564390c3dd578e87a38352a4c974f20d8
5
5
  SHA512:
6
- metadata.gz: 1a10a4d380dbab3d0e3c152fae9877d66872fa1cda68c493826342a59a629b4bc325dfd6abc6cd24e0c64b5064d10d60edba683152e6c0517c5587a6fe1e8010
7
- data.tar.gz: ea96dc4874e8a2e8564927ec5c335a3077c2e3ea9417f170aa8f20f17f91b6c2e0bbee69091783a7a6b81a13a76be1e467d6718a247f33f6ff12926ac3c6479a
6
+ metadata.gz: d342f815f27ebdf91df95cb5970ec0a75b37c251e988f0e549d00a25e22028cf1ecd47ed6d9c280511171966cb062d3ac46ebfc7ad8246354a9d3e5a5f25f20c
7
+ data.tar.gz: 25fb6d4fc2fe0309e4aea0503cf01ae2d90e6089d89d273083a91e6282b7dd11a61fd038c8e18d96ed8faf6c033c1fff198a83a45364b577e56da18548261aaa
data/bin/cftool CHANGED
@@ -5,9 +5,9 @@ require 'cloud_formation_tool'
5
5
  begin
6
6
  CloudFormationTool::CLI::Main.run
7
7
  rescue SocketError => e
8
- warn "Networking error: #{e.message}"
8
+ _warn "Networking error: #{e.message}"
9
9
  exit 1
10
10
  rescue CloudFormationTool::Errors::BaseError => e
11
- warn e.message
11
+ _warn e.message
12
12
  exit 1
13
13
  end
@@ -16,8 +16,8 @@ module CloudFormationTool
16
16
  inv.wait
17
17
  log "Invalidation #{inv.id}: #{inv.status}"
18
18
  end
19
- end.each(&:join).length > 0 or error "No valid CloudFront distributions found"
19
+ end.each(&:join).length > 0 or _error "No valid CloudFront distributions found"
20
20
  end
21
21
  end
22
22
  end
23
- end
23
+ end
@@ -16,7 +16,7 @@ module CloudFormationTool
16
16
  sleep 1
17
17
  end
18
18
  rescue CloudFormationTool::Errors::StackDoesNotExistError => e
19
- error "Stack #{stack_name} does not exist"
19
+ _error "Stack #{stack_name} does not exist"
20
20
  rescue SystemExit, Interrupt => e
21
21
  # CTRL-C out of the loop
22
22
  puts "\n"
@@ -25,4 +25,4 @@ module CloudFormationTool
25
25
 
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -31,8 +31,8 @@ module CloudFormationTool
31
31
  puts "#{grp.name}: Left to recycle - #{torecycle}"
32
32
  end
33
33
  end
34
- end.each(&:join).length > 0 or error "No valid Autoscaling groups found named #{asg_name}"
34
+ end.each(&:join).length > 0 or _error "No valid Autoscaling groups found named #{asg_name}"
35
35
  end
36
36
  end
37
37
  end
38
- end
38
+ end
@@ -22,16 +22,16 @@ module CloudFormationTool
22
22
  end
23
23
 
24
24
  def execute
25
- debug "Starting scale operations"
25
+ _debug "Starting scale operations"
26
26
  st = CloudFormation::Stack.new(stack_name)
27
27
  st.asgroups.select do |res|
28
- debug "Checking group #{res.logical_resource_id}"
28
+ _debug "Checking group #{res.logical_resource_id}"
29
29
  asg_name.nil? or (res.logical_resource_id == asg_name)
30
30
  end.collect do |res|
31
- debug "Scaling #{res.logical_resource_id}"
31
+ _debug "Scaling #{res.logical_resource_id}"
32
32
  Thread.new do
33
33
  grp = res.group
34
- debug "Current capacity: #{grp.desired_capacity}, setting to #{scale}"
34
+ _debug "Current capacity: #{grp.desired_capacity}, setting to #{scale}"
35
35
  grp.set_desired_capacity(desired_capacity: scale)
36
36
  last_state = nil
37
37
  until stable_scale(grp, scale)
@@ -9,10 +9,10 @@ module CloudFormationTool
9
9
  if CloudFormation::Stack.new(stack_name).exist?
10
10
  log "OK"
11
11
  else
12
- error "Stack #{stack_name} does not exist"
12
+ _error "Stack #{stack_name} does not exist"
13
13
  end
14
14
  end
15
15
 
16
16
  end
17
17
  end
18
- end
18
+ end
@@ -20,12 +20,12 @@ module CloudFormationTool
20
20
  end
21
21
 
22
22
  def handle_url
23
- debug "Trying Lambda code from #{@data['Url']}"
23
+ _debug "Trying Lambda code from #{@data['Url']}"
24
24
  @data['Url'] = url = @tpl.resolveVal(@data['Url'])
25
25
  return unless url.is_a? String
26
26
  log "Downloading Lambda code from #{url}"
27
27
  if already_in_cache(url)
28
- debug "Reusing remote cached object instead of downloading"
28
+ _debug "Reusing remote cached object instead of downloading"
29
29
  else
30
30
  res = fetch_from_url(url)
31
31
  @s3_url = URI(upload(make_filename(url.split('.').last), res.body, mime_type: res['content-type'], gzip: false))
@@ -36,7 +36,7 @@ module CloudFormationTool
36
36
  def handle_path
37
37
  @data['Path'] = path = @tpl.resolveVal(@data['Path'])
38
38
  return unless path.is_a? String
39
- debug "Reading Lambda code from #{path}"
39
+ _debug "Reading Lambda code from #{path}"
40
40
  path = if path.start_with? "/" then path else "#{@tpl.basedir}/#{path}" end
41
41
  if File.directory?(path)
42
42
  @s3_url = URI(upload(make_filename('zip'), zip_path(path), mime_type: 'application/zip', gzip: false))
@@ -69,7 +69,7 @@ module CloudFormationTool
69
69
  def zip_path(path)
70
70
  Zip::OutputStream.write_buffer do |zf|
71
71
  rdir path do |ent|
72
- debug "Deflating #{ent}"
72
+ _debug "Deflating #{ent}"
73
73
  filepath = File.join(path,ent)
74
74
  zf.put_next_entry ::Zip::Entry.new(nil, ent, nil, nil, nil, nil, nil, nil, ::Zip::DOSTime.at(File.mtime(filepath).to_i))
75
75
  zf.write File.read(filepath)
@@ -93,7 +93,7 @@ module CloudFormationTool
93
93
  break if check_cached(response['ETag']) # dont read the body if its already cached
94
94
  when Net::HTTPRedirection then
95
95
  location = response['location']
96
- debug "Cache check redirected to #{location}"
96
+ _debug "Cache check redirected to #{location}"
97
97
  limit = limit - 1
98
98
  response.body
99
99
  url = URI(location)
@@ -178,4 +178,4 @@ module CloudFormationTool
178
178
  end
179
179
 
180
180
  end
181
- end
181
+ end
@@ -47,10 +47,10 @@ module CloudFormationTool
47
47
  file_opts.delete :acl
48
48
  end
49
49
  file_opts.merge!({content_encoding: 'gzip'}) if gzip
50
- debug "Uploading S3 object s3://#{b.name}/#{o.key}"
50
+ _debug "Uploading S3 object s3://#{b.name}/#{o.key}"
51
51
  o.put(file_opts)
52
52
  else
53
- debug "re-using cached object"
53
+ _debug "re-using cached object"
54
54
  end
55
55
  o.public_url
56
56
  end
@@ -1,3 +1,3 @@
1
1
  module CloudFormationTool
2
- VERSION = '1.5.16'
2
+ VERSION = '1.5.18'
3
3
  end
@@ -15,7 +15,7 @@ def log(message = nil, &block)
15
15
  end)
16
16
  end
17
17
 
18
- def debug(message = nul, &block)
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 = nul, &block)
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 = nul, &block)
34
+ def _error(message = nil, &block)
35
35
  logger.error(if message.nil?
36
36
  yield
37
37
  else
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudformation-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.16
4
+ version: 1.5.18
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: 2024-06-02 00:00:00.000000000 Z
11
+ date: 2024-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: base64
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rake
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +178,7 @@ dependencies:
164
178
  - - ">="
165
179
  - !ruby/object:Gem::Version
166
180
  version: '0'
167
- description:
181
+ description:
168
182
  email: oded.arbel@greenfieldtech.net
169
183
  executables:
170
184
  - cftool
@@ -207,7 +221,7 @@ homepage: http://github.com/GreenfieldTech/cloudformation-tool
207
221
  licenses:
208
222
  - GPL-2.0
209
223
  metadata: {}
210
- post_install_message:
224
+ post_install_message:
211
225
  rdoc_options: []
212
226
  require_paths:
213
227
  - lib
@@ -222,8 +236,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
236
  - !ruby/object:Gem::Version
223
237
  version: '0'
224
238
  requirements: []
225
- rubygems_version: 3.3.5
226
- signing_key:
239
+ rubygems_version: 3.4.20
240
+ signing_key:
227
241
  specification_version: 4
228
242
  summary: A pre-compiler tool for CloudFormation YAML templates
229
243
  test_files: []