File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 18
18
require 'json'
19
19
require 'open3'
20
20
21
- CAPTUREFROMSTACK = 'terraform-config-inspect --json'
22
- ENVNAME = 'KITCHEN_SUITE_NAME'
23
- OUTPUTSTF = './stackmodulesoutputs.tf'
24
- BANNER = "# This file has been created automatically.\n \n "
25
- INSPEC_YMLHEAD = <<~MYYML
21
+ CAPTUREFROMSTACK = 'terraform-config-inspect --json'
22
+ ENVNAME = 'KITCHEN_SUITE_NAME'
23
+ OUTPUTSTF = './stackmodulesoutputs.tf'
24
+ BANNER = "# This file has been created automatically.\n \n "
25
+ INSPECYMLTMPLFILE = './test/integration/default/inspec.yml.tmpl'
26
+ INSPECYMLTMPLSTR = <<~MYYML
26
27
---
27
28
name: stackdefault
28
29
supports:
31
32
- name: inspec-aws
32
33
git: https://github.com/inspec/inspec-aws
33
34
tag: v1.33.0
34
- # Begin - blueprint inspec profiles
35
- #{ ' ' }
36
35
MYYML
37
36
37
+ INSPECYMLHEAD = if File . exist? ( INSPECYMLTMPLFILE )
38
+ File . read ( INSPECYMLTMPLFILE )
39
+ else
40
+ INSPECYMLTMPLSTR
41
+ end
42
+
38
43
stdout , _stderr , _status = Open3 . capture3 ( CAPTUREFROMSTACK )
39
44
40
45
myEnv = ENV . fetch ( ENVNAME , 'default' )
56
61
modoutTF . write ( BANNER )
57
62
allBPsRB . write ( BANNER )
58
63
inspecYML . write ( BANNER )
59
- inspecYML . write ( INSPEC_YMLHEAD )
64
+ inspecYML . write ( INSPECYMLHEAD )
60
65
61
66
# get module section from main.json
62
67
allModules = JSON . parse ( stdout ) [ 'module_calls' ]
You can’t perform that action at this time.
0 commit comments