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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7648a4ce929eaf9c6ae05202aea0eafd81ea4f0e
4
- data.tar.gz: 1f1b628411d96a2f6ab322510895fc0485d2b509
3
+ metadata.gz: f56f2af0cfeec590f12172b55f424593b2eeefa9
4
+ data.tar.gz: 4ce34552f09fc64a8f27a61f341f6be7e3ac0360
5
5
  SHA512:
6
- metadata.gz: c4a102df223ea3d82587ea183b9d5dcd4db457ebed2bb8943a3179709533c9cbf644de3f8f7472ce60e8690a99f80870b1bea63c4f8811d0628bd3e34956698b
7
- data.tar.gz: 4885e2f4d9785d442887fcd871823f707320b226d3bf2fde27052bed4ce4804629d3f0a9d6cba0ea676358e648fcfaaf3cf3e5bf3a7aa1d88813e52039f4bdb0
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
- FileUtils.mkdir_p(sandbox_path)
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
- FileUtils.cp_r(File.join(config[:kitchen_root], config[:modules_path]), File.join(sandbox_path, 'modules'))
50
- FileUtils.cp(File.join(config[:kitchen_root], config[:configuration_script]), File.join(sandbox_path, 'dsc_configuration.ps1'))
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
- . #{remote_path_join( config[:root_path], config[:configuration_script])}
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kitchen
4
4
  module Dsc
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-dsc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Murawski