cfhighlander 0.3.1 → 0.3.2

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: f21fd5ed213981ccad9e067ac5ddef3d514bf7b2068502b2af1a7a95b9884718
4
- data.tar.gz: 9828daf82341fe563f88828ef00346395575ef29fd405c53093caf1c0cb02c14
3
+ metadata.gz: 152c69286789dce8eda5ae3cee32f40be1db507e3bafee8daf3bf70283425ea9
4
+ data.tar.gz: 8bd56c2f7bb9ec443de17abc8076df3e5890373139fd211679e2dc2d0f25d5dc
5
5
  SHA512:
6
- metadata.gz: 7bec060a285e620fab51464acd4c3dc8c4cc0376867abe9711affead8f2b02c13038c3e305e4e6b1ffa7a690d62e8450c3c04d1a125d9b7e8753c38a9f8537de
7
- data.tar.gz: d1e47a92493c6c2c72a92a342025ea666dbebfd23fc49b9335c532a12fd96dadcf12e9f08dfd61a14417213db52ea7478e68f554a88363869d0a31e37866d4ee
6
+ metadata.gz: 52068fd9dfb6aa59f506afc83f50298eccb6fd23a4be68a1862ae53a1515bf0c28abd881b5fb38aaea229eb5447bf12bf9159ab3763e4eb2eb53e3885c36cd50
7
+ data.tar.gz: 34839cbc644eb091a0b1f8bda5f236ba0f388393852c62c6e20a9549e904b91ace3ba6b5c9a0ec6b019f16d55d0085d5612051a2c7d1195d08129394824d16aa
@@ -61,6 +61,9 @@ def render_lambda_functions(cfndsl, lambdas, lambda_metadata, distribution)
61
61
  FunctionName(Ref(name))
62
62
  Action('lambda:InvokeFunction')
63
63
  Principal(source['principal'])
64
+ if source.key? 'source_arn'
65
+ SourceArn source['source_arn']
66
+ end
64
67
  end
65
68
  i += 1
66
69
  end
@@ -271,14 +271,25 @@ module Cfhighlander
271
271
  end
272
272
  else
273
273
  # zip local code
274
- zip_options = ''
275
- full_path = "#{@component_dir}/lambdas/#{lambda_config['code']}"
274
+ component = @component
275
+ component_dir = component.template.template_location
276
+ full_path = "#{component_dir}/lambdas/#{lambda_config['code']}"
277
+
278
+ until (File.exist? full_path or component_dir.nil?)
279
+ parent_exists = (not component.extended_component.nil?)
280
+ component = component.extended_component if parent_exists
281
+ component_dir = component.template.template_location if parent_exists
282
+ full_path = "#{component_dir}/lambdas/#{lambda_config['code']}" if parent_exists
283
+ component_dir = nil unless parent_exists
284
+ end
285
+ if component_dir.nil?
286
+ STDERR.puts "ERROR: Could not find source code directory for lambda function #{name} in component #{@component.name}"
287
+ exit -9
288
+ end
276
289
 
277
290
  # lambda source can be either path to file or directory within that file
278
291
  # optionally, lambda source code
279
292
  lambda_source_dir = File.dirname(full_path)
280
- lambda_source_file = File.basename(full_path)
281
- lambda_source_file = '.' if Pathname.new(full_path).directory?
282
293
  lambda_source_dir = full_path if Pathname.new(full_path).directory?
283
294
 
284
295
  # executing package command can generate files. We DO NOT want this file in source directory,
@@ -174,7 +174,7 @@ module Cfhighlander
174
174
  if not @parent_template.nil?
175
175
  extended_component = @factory.loadComponentFromTemplate(@parent_template)
176
176
  extended_component.is_parent_component = true
177
- extended_component.load()
177
+ extended_component.load(@config)
178
178
 
179
179
  @config = extended_component.config.extend(@config)
180
180
  @mappings = extended_component.mappings.extend(@mappings)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfhighlander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikola Tosic
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-07-16 00:00:00.000000000 Z
12
+ date: 2018-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline