kitchen-dsc 0.1.0 → 0.1.2
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/lib/kitchen/provisioner/dsc.rb +18 -10
- data/lib/kitchen-dsc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f56f2af0cfeec590f12172b55f424593b2eeefa9
|
|
4
|
+
data.tar.gz: 4ce34552f09fc64a8f27a61f341f6be7e3ac0360
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c3aaf48b5c09b0d0801e5ef5fcee9c3962fa4600ea08b2d4de164eb8abaa5691ec4c5dc2be7c233c9310604ab8289e24bc292d2f81f8185765069bc5de33f56d
|
|
7
|
+
data.tar.gz: fc2de1fe451d96aa6d6680f957be61eb77dcc3527c40e77ee9d08e25f24868d3e1bb0ed37df228b7022820ede299decc9ea31826e4e792eac4bc9b6dd58e3372
|
|
@@ -43,40 +43,48 @@ module Kitchen
|
|
|
43
43
|
|
|
44
44
|
def create_sandbox
|
|
45
45
|
super
|
|
46
|
-
|
|
46
|
+
module_path = File.join(config[:kitchen_root], config[:modules_path])
|
|
47
|
+
sandbox_module_path = File.join(sandbox_path, 'modules')
|
|
48
|
+
configuration_script_path = File.join(config[:kitchen_root], config[:configuration_script])
|
|
49
|
+
sandbox_configuration_script_path = File.join(sandbox_path, config[:configuration_script])
|
|
47
50
|
|
|
48
51
|
info('Staging DSC Resource Modules for copy to the SUT')
|
|
49
|
-
|
|
50
|
-
FileUtils.
|
|
52
|
+
debug("Moving #{module_path} to #{sandbox_module_path}")
|
|
53
|
+
FileUtils.cp_r(module_path, sandbox_module_path)
|
|
54
|
+
|
|
55
|
+
debug("Moving #{configuration_script_path} to #{sandbox_configuration_script_path}")
|
|
56
|
+
FileUtils.cp(configuration_script_path, sandbox_configuration_script_path)
|
|
51
57
|
end
|
|
52
58
|
|
|
53
59
|
def prepare_command
|
|
54
60
|
info('Moving DSC Resources onto PSModulePath')
|
|
55
61
|
info("Generating the MOF script for the configuration #{current_configuration}")
|
|
56
|
-
|
|
57
62
|
stage_resources_and_generate_mof_script = <<-EOH
|
|
58
|
-
|
|
59
63
|
dir ( join-path #{config[:root_path]} 'modules/*') -directory |
|
|
60
64
|
copy-item -destination $env:programfiles/windowspowershell/modules/ -recurse -force
|
|
61
65
|
|
|
62
66
|
mkdir 'c:/configurations' | out-null
|
|
63
|
-
|
|
67
|
+
$ConfigurationScriptPath = Join-path #{config[:root_path]} #{config[:configuration_script]}
|
|
68
|
+
if (-not (test-path $ConfigurationScriptPath))
|
|
69
|
+
{
|
|
70
|
+
throw "Failed to find $ConfigurationScriptPath"
|
|
71
|
+
}
|
|
72
|
+
invoke-expression (get-content $ConfigurationScriptPath -raw)
|
|
64
73
|
#{current_configuration} -outputpath c:/configurations | out-null
|
|
65
|
-
|
|
66
74
|
EOH
|
|
67
|
-
|
|
75
|
+
debug("Shelling out: #{stage_resources_and_generate_mof_script}")
|
|
68
76
|
wrap_shell_code(stage_resources_and_generate_mof_script)
|
|
69
77
|
end
|
|
70
78
|
|
|
71
79
|
def run_command
|
|
72
80
|
info("Running the configuration #{current_configuration}")
|
|
73
81
|
run_configuration_script = <<-EOH
|
|
74
|
-
|
|
75
82
|
$job = start-dscconfiguration -Path c:/configurations/
|
|
76
83
|
$job | wait-job
|
|
77
84
|
$job.childjobs[0].verbose
|
|
78
|
-
|
|
79
85
|
EOH
|
|
86
|
+
|
|
87
|
+
debug("Shelling out: #{run_configuration_script}")
|
|
80
88
|
wrap_shell_code(run_configuration_script)
|
|
81
89
|
end
|
|
82
90
|
|
data/lib/kitchen-dsc/version.rb
CHANGED