cfhighlander 0.4.0.alpha.1531468125 → 0.4.0.alpha.1531716185

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cfhighlander.compiler.rb +18 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b7f58f63b43165d981517f1889394622596a4bb29310603cace6a499a97eae0
4
- data.tar.gz: 036e82c1936b723258a06d1629925090f683072220c767a3abf6f0bd18631f71
3
+ metadata.gz: 95035851d92d8fcf3dde0d86b107498f9fdedd264e7e4a2f5a0c0dda39950886
4
+ data.tar.gz: 139556f3126d5e2597595e99b44fdb1dabd6d9effc9c677d3bdafa8dfffbdb44
5
5
  SHA512:
6
- metadata.gz: c1a9d52b0cfb141b626c3ed80a9538195722be9c89fdbbcf61c370729e7acebafea26ff286c0f06492854a78a9099e7c3d830529e7ffb7b43fc839b4843c779a
7
- data.tar.gz: 862f7dccfe02cd336f6606acc12b2fd4e5a22c2eaec135e41e73520eb507b1c6b1a2f5fb63da7c5d0770d82b22a7b884e9e21c84a43058e3055dc74fc65ddb58
6
+ metadata.gz: abe71d4fff57e2741ef021260d77a6468c155084152ae9656196ec02808e4fb109cb0b8fa141b6c2e6df1f8903da80bea4ac32abb1d0b03cf4333cb182b3c37c
7
+ data.tar.gz: 0aaf15811dc21e3799fd505b13c4aa6c47f99b0bdc29807c939317f9690402a28f66398537e7a8517239e9b34b18da4e9396308fbf139408c7f2594ff88a2f7c
@@ -50,7 +50,7 @@ module Cfhighlander
50
50
 
51
51
  if @@global_extensions_paths.empty?
52
52
  global_extensions_folder = "#{File.dirname(__FILE__)}/../cfndsl_ext"
53
- Dir["#{global_extensions_folder}/*.rb"].each { |f| @@global_extensions_paths << f }
53
+ Dir["#{global_extensions_folder}/*.rb"].each {|f| @@global_extensions_paths << f}
54
54
  end
55
55
 
56
56
  @component.highlander_dsl.subcomponents.each do |sub_component|
@@ -62,12 +62,12 @@ module Cfhighlander
62
62
 
63
63
  def process_lambdas=(value)
64
64
  @process_lambdas = value
65
- @sub_components.each { |scc| scc.process_lambdas=value }
65
+ @sub_components.each {|scc| scc.process_lambdas = value}
66
66
  end
67
67
 
68
68
  def silent_mode=(value)
69
69
  @silent_mode = value
70
- @sub_components.each { |scc| scc.silent_mode=value }
70
+ @sub_components.each {|scc| scc.silent_mode = value}
71
71
  end
72
72
 
73
73
  def compileCfnDsl(out_format)
@@ -76,7 +76,7 @@ module Cfhighlander
76
76
  dsl = @component.highlander_dsl
77
77
  component_cfndsl = @component.cfndsl_content
78
78
 
79
- @component.highlander_dsl.subcomponents.each { |sc|
79
+ @component.highlander_dsl.subcomponents.each {|sc|
80
80
  sc.distribution_format = out_format
81
81
  }
82
82
 
@@ -89,7 +89,7 @@ module Cfhighlander
89
89
  'dsl' => dsl,
90
90
  'component_cfndsl' => component_cfndsl,
91
91
  'component_requires' => (@@global_extensions_paths + @component.cfndsl_ext_files)
92
- }).instance_eval { binding })
92
+ }).instance_eval {binding})
93
93
 
94
94
  # write to output file
95
95
  output_dir = "#{@workdir}/out/cfndsl"
@@ -100,7 +100,7 @@ module Cfhighlander
100
100
  puts "cfndsl template for #{dsl.name} written to #{output_path}"
101
101
  @cfndsl_compiled_path = output_path
102
102
 
103
- @sub_components.each { |subcomponent_compiler|
103
+ @sub_components.each {|subcomponent_compiler|
104
104
  puts "Rendering sub-component cfndsl: #{subcomponent_compiler.component_name}"
105
105
  subcomponent_compiler.compileCfnDsl out_format
106
106
  }
@@ -232,8 +232,16 @@ module Cfhighlander
232
232
  file_name = "#{name}.#{@component.name}.#{@component.version}.#{timestamp}.zip"
233
233
  @metadata['path'][name] = file_name
234
234
  full_destination_path = "#{out_folder}#{file_name}"
235
+ info_path = "#{out_folder}#{file_name}.info.yaml"
235
236
  archive_paths << full_destination_path
236
237
  FileUtils.mkdir_p out_folder
238
+ File.write(info_path, {
239
+ 'component' => @component.name,
240
+ 'function' => name,
241
+ 'packagedAt' => timestamp,
242
+ 'config' => lambda_config
243
+ }.to_yaml)
244
+
237
245
  # clear destination if already there
238
246
  FileUtils.remove full_destination_path if File.exist? full_destination_path
239
247
 
@@ -302,7 +310,10 @@ module Cfhighlander
302
310
  zip_generator.write
303
311
 
304
312
  end
305
-
313
+ # add version information to avoid same package ever deployed 2 times
314
+ Zip::File.open(full_destination_path) do |zipfile|
315
+ zipfile.add 'hlpackage_info.txt', info_path
316
+ end
306
317
  sha256 = Digest::SHA256.file full_destination_path
307
318
  sha256 = sha256.base64digest
308
319
  puts "Created zip package #{full_destination_path} for lambda #{name} with digest #{sha256}"
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.4.0.alpha.1531468125
4
+ version: 0.4.0.alpha.1531716185
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-13 00:00:00.000000000 Z
12
+ date: 2018-07-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline