sfn 3.1.4 → 3.1.6
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/CHANGELOG.md +5 -0
- data/lib/sfn/command/trace.rb +8 -0
- data/lib/sfn/command/validate.rb +36 -17
- data/lib/sfn/command_module/template.rb +3 -0
- data/lib/sfn/config/validate.rb +8 -0
- data/lib/sfn/version.rb +1 -1
- data/sfn.gemspec +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: 970e23327f10a5779f02b8f39168b1345a17ece34b108facde5c046a9d68637d
|
4
|
+
data.tar.gz: f7ef6ddea26b4f3a60c499092b9aed690d6a1c73c569ff8e72638a4c1f7a7c77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 944b96fbf6832a33295feca36cc603cb9b581493b015627284c62c19e0b89f5bf2450a3219258897ed42d58f54b3e2ee06c17e498751d28fdafce394c8d1002a
|
7
|
+
data.tar.gz: 764508bb435d2da04dd49384e3c049061828bd64dc00a8b082119de8f41da3f650662d00019828cd660ad9772659e91ac4ed213a07078976cd920f3ba6517159
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
# v3.1.6
|
2
|
+
* [enhancement] Add `all` and `group` validate options (#299)
|
3
|
+
* [enhancement] Add timing information to template tracing (#296)
|
4
|
+
* [fix] Provide useful error when `nesting_bucket` option is unset
|
5
|
+
|
1
6
|
# v3.1.4
|
2
7
|
* [fix] Fix apply mapping implementation (#295)
|
3
8
|
|
data/lib/sfn/command/trace.rb
CHANGED
@@ -35,9 +35,17 @@ module Sfn
|
|
35
35
|
else
|
36
36
|
origin << ui.color(record.caller.path, :yellow)
|
37
37
|
end
|
38
|
+
duration = "#{indent} | duration: "
|
39
|
+
if record.compile_duration
|
40
|
+
duration << Kernel.sprintf("%0.4f", record.compile_duration)
|
41
|
+
duration << "s"
|
42
|
+
else
|
43
|
+
duration < "N/A"
|
44
|
+
end
|
38
45
|
ui.info header
|
39
46
|
ui.info source
|
40
47
|
ui.info origin
|
48
|
+
ui.info duration
|
41
49
|
if record.audit_log.count > 0
|
42
50
|
writer.call(record.audit_log, indent + " |")
|
43
51
|
end
|
data/lib/sfn/command/validate.rb
CHANGED
@@ -10,25 +10,42 @@ module Sfn
|
|
10
10
|
include Sfn::CommandModule::Stack
|
11
11
|
|
12
12
|
def execute!
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
if config[:all]
|
14
|
+
validate_templates = sparkle_collection.templates[sparkle_collection.provider].keys
|
15
|
+
elsif config[:group]
|
16
|
+
validate_templates = sparkle_collection.templates[sparkle_collection.provider].keys.select do |template|
|
17
|
+
template.split("__").first == config[:group]
|
18
|
+
end
|
19
|
+
else
|
20
|
+
validate_templates = [config[:file]]
|
21
|
+
end
|
18
22
|
|
19
|
-
|
23
|
+
if validate_templates.empty?
|
24
|
+
load_template_file
|
25
|
+
validate_templates.push(config[:file])
|
26
|
+
end
|
20
27
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
validate_templates.each do |template|
|
29
|
+
config[:file] = template
|
30
|
+
print_only_original = config[:print_only]
|
31
|
+
config[:print_only] = true
|
32
|
+
ui.info "#{ui.color("Template Validation (#{provider.connection.provider}): ", :bold)} #{config[:file].sub(Dir.pwd, "").sub(%r{^/}, "")}"
|
33
|
+
file = load_template_file
|
34
|
+
config[:print_only] = print_only_original
|
35
|
+
raw_template = _format_json(parameter_scrub!(template_content(file)))
|
36
|
+
|
37
|
+
if config[:print_only]
|
38
|
+
ui.puts raw_template
|
39
|
+
else
|
40
|
+
validate_stack(
|
41
|
+
file.respond_to?(:dump) ? file.dump : file,
|
42
|
+
if config[:processing]
|
43
|
+
sparkle_collection.get(:template, config[:file])[:name]
|
44
|
+
else
|
45
|
+
config[:file]
|
46
|
+
end
|
47
|
+
)
|
48
|
+
end
|
32
49
|
end
|
33
50
|
end
|
34
51
|
|
@@ -71,6 +88,8 @@ module Sfn
|
|
71
88
|
ui.fatal e.message
|
72
89
|
raise e
|
73
90
|
end
|
91
|
+
# Clear Compile Time Parameters from Config
|
92
|
+
config[:compile_parameters] = {}
|
74
93
|
end
|
75
94
|
end
|
76
95
|
end
|
@@ -387,6 +387,9 @@ module Sfn
|
|
387
387
|
# @return [Hash]
|
388
388
|
def store_template(full_stack_name, template, result)
|
389
389
|
stack_definition = template.is_a?(SparkleFormation) ? dump_stack_for_storage(template) : template
|
390
|
+
if config[:nesting_bucket].to_s.empty?
|
391
|
+
raise "Missing required value for option `nesting_bucket`."
|
392
|
+
end
|
390
393
|
bucket = provider.connection.api_for(:storage).buckets.get(
|
391
394
|
config[:nesting_bucket]
|
392
395
|
)
|
data/lib/sfn/config/validate.rb
CHANGED
@@ -113,6 +113,14 @@ module Sfn
|
|
113
113
|
:upload_root_template, [TrueClass, FalseClass],
|
114
114
|
:description => "Upload root template to storage bucket",
|
115
115
|
)
|
116
|
+
attribute(
|
117
|
+
:all, [TrueClass, FalseClass],
|
118
|
+
:description => "Validate all templates",
|
119
|
+
)
|
120
|
+
attribute(
|
121
|
+
:group, String,
|
122
|
+
:description => "Validate templates with the specified group prefix",
|
123
|
+
)
|
116
124
|
end
|
117
125
|
end
|
118
126
|
end
|
data/lib/sfn/version.rb
CHANGED
data/sfn.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_runtime_dependency "miasma-terraform", ">= 0.1.0", "< 0.2.0"
|
22
22
|
s.add_runtime_dependency "jmespath"
|
23
23
|
s.add_runtime_dependency "net-ssh"
|
24
|
-
s.add_runtime_dependency "sparkle_formation", ">= 3.0.
|
24
|
+
s.add_runtime_dependency "sparkle_formation", ">= 3.0.39", "< 4"
|
25
25
|
s.add_runtime_dependency "hashdiff", "~> 0.2.2"
|
26
26
|
s.add_runtime_dependency "graph", "~> 2.8.1"
|
27
27
|
s.add_development_dependency "rake", "~> 10"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sfn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bogo-cli
|
@@ -224,7 +224,7 @@ dependencies:
|
|
224
224
|
requirements:
|
225
225
|
- - ">="
|
226
226
|
- !ruby/object:Gem::Version
|
227
|
-
version: 3.0.
|
227
|
+
version: 3.0.39
|
228
228
|
- - "<"
|
229
229
|
- !ruby/object:Gem::Version
|
230
230
|
version: '4'
|
@@ -234,7 +234,7 @@ dependencies:
|
|
234
234
|
requirements:
|
235
235
|
- - ">="
|
236
236
|
- !ruby/object:Gem::Version
|
237
|
-
version: 3.0.
|
237
|
+
version: 3.0.39
|
238
238
|
- - "<"
|
239
239
|
- !ruby/object:Gem::Version
|
240
240
|
version: '4'
|