cfhighlander 0.11.0 → 0.11.1.alpha.1583312876
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cfhighlander.compiler.rb +26 -6
- data/lib/cfhighlander.model.component.rb +1 -0
- data/lib/cfhighlander.version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28bc554f5dbe5d89db3a0d12d0649903c2b59b976c63110530dd9e0ec754a314
|
4
|
+
data.tar.gz: 1404f65182b6826821c9e227cce60002e6f7ec0d84f4a691c6af2e8862cb46db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fca227daacfa6a41fa7f177ebcfd81937c9a5a5b3effa21ab3d7be200cf1a8f052fde8ffedde07b80ca1ecab3856482f089adb429d2ff024070a6c3086a503e
|
7
|
+
data.tar.gz: 19b1bd7103256a3c0a6530cc407a5d560dc12513b0a81efd0842eb052676c34ebb0f5a9cb7cc47c71c9a9c57115af8913b94d1852ba5c69f2eb474c4e0fe88ea
|
@@ -31,7 +31,8 @@ module Cfhighlander
|
|
31
31
|
:cfn_template_paths,
|
32
32
|
:silent_mode,
|
33
33
|
:lambda_src_paths,
|
34
|
-
:process_lambdas
|
34
|
+
:process_lambdas,
|
35
|
+
:lambda_mock_resolve
|
35
36
|
|
36
37
|
def initialize(component)
|
37
38
|
|
@@ -48,6 +49,7 @@ module Cfhighlander
|
|
48
49
|
@config_yaml_path = nil
|
49
50
|
@cfn_model = nil
|
50
51
|
@process_lambdas = true
|
52
|
+
@lambda_mock_resolve = false
|
51
53
|
|
52
54
|
if @@global_extensions_paths.empty?
|
53
55
|
global_extensions_folder = "#{File.dirname(__FILE__)}/../cfndsl_ext"
|
@@ -76,6 +78,11 @@ module Cfhighlander
|
|
76
78
|
@sub_components.each { |scc| scc.silent_mode = value }
|
77
79
|
end
|
78
80
|
|
81
|
+
def lambda_mock_resolve=(value)
|
82
|
+
@lambda_mock_resolve = value
|
83
|
+
@sub_components.each { |scc| scc.lambda_mock_resolve = value }
|
84
|
+
end
|
85
|
+
|
79
86
|
def compileCfnDsl(out_format)
|
80
87
|
processLambdas unless @lambdas_processed
|
81
88
|
writeConfig unless @config_written
|
@@ -211,7 +218,8 @@ module Cfhighlander
|
|
211
218
|
resolver = LambdaResolver.new(@component,
|
212
219
|
lfk,
|
213
220
|
@workdir,
|
214
|
-
(not @silent_mode)
|
221
|
+
(not @silent_mode),
|
222
|
+
@lambda_mock_resolve
|
215
223
|
)
|
216
224
|
@lambda_src_paths += resolver.generateSourceArchives if @process_lambdas
|
217
225
|
resolver.mergeComponentConfig
|
@@ -226,7 +234,8 @@ module Cfhighlander
|
|
226
234
|
|
227
235
|
class LambdaResolver
|
228
236
|
|
229
|
-
def initialize(component, lambda_key, workdir, confirm_code_execution = true
|
237
|
+
def initialize(component, lambda_key, workdir, confirm_code_execution = true,
|
238
|
+
mock_resolve=false)
|
230
239
|
@component = component
|
231
240
|
@lambda_config = @component.config[lambda_key]
|
232
241
|
@component_dir = @component.component_dir
|
@@ -237,10 +246,11 @@ module Cfhighlander
|
|
237
246
|
'version' => {}
|
238
247
|
}
|
239
248
|
@confirm_code_execution = confirm_code_execution
|
249
|
+
@mock_resolve = mock_resolve
|
240
250
|
end
|
241
251
|
|
242
252
|
def generateSourceArchives
|
243
|
-
|
253
|
+
return generateMockArchives if @mock_resolve
|
244
254
|
archive_paths = []
|
245
255
|
|
246
256
|
# Cached downloads map
|
@@ -389,10 +399,20 @@ module Cfhighlander
|
|
389
399
|
return archive_paths
|
390
400
|
end
|
391
401
|
|
402
|
+
def generateMockArchives
|
403
|
+
@lambda_config['functions'].each do |name, _|
|
404
|
+
@metadata['sha256'][name] = 'mockSHA'
|
405
|
+
@metadata['version'][name] = 'mockVersion'
|
406
|
+
end
|
407
|
+
return []
|
408
|
+
end
|
409
|
+
|
392
410
|
def mergeComponentConfig
|
393
411
|
if @component.config.key? 'lambda_metadata'
|
394
|
-
@metadata.each do |mk,mh|
|
395
|
-
mh.each do |k,v|
|
412
|
+
@metadata.each do |mk, mh|
|
413
|
+
mh.each do |k, v|
|
414
|
+
@component.config['lambda_metadata'][mk][k] = v
|
415
|
+
end
|
396
416
|
end
|
397
417
|
else
|
398
418
|
@component.config['lambda_metadata'] = @metadata
|
@@ -241,6 +241,7 @@ module Cfhighlander
|
|
241
241
|
end
|
242
242
|
def eval_cfndsl
|
243
243
|
compiler = Cfhighlander::Compiler::ComponentCompiler.new self
|
244
|
+
compiler.lambda_mock_resolve = true
|
244
245
|
@cfn_model = compiler.evaluateCloudFormation().as_json
|
245
246
|
@cfn_model_raw = JSON.parse(@cfn_model.to_json)
|
246
247
|
@outputs = (
|
data/lib/cfhighlander.version.rb
CHANGED
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.11.
|
4
|
+
version: 0.11.1.alpha.1583312876
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikola Tosic
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-03-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: highline
|
@@ -277,9 +277,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
277
277
|
version: '0'
|
278
278
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
279
279
|
requirements:
|
280
|
-
- - "
|
280
|
+
- - ">"
|
281
281
|
- !ruby/object:Gem::Version
|
282
|
-
version:
|
282
|
+
version: 1.3.1
|
283
283
|
requirements: []
|
284
284
|
rubyforge_project:
|
285
285
|
rubygems_version: 2.7.7
|