-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathRakefile
50 lines (38 loc) · 1.43 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require 'bundler/setup'
require 'rspec/core/rake_task'
task :default => [:spec, :smoke_test]
RSpec::Core::RakeTask.new(:spec)
desc "Run test manifests"
task :smoke_test do
Dir.glob('tests/**/*.pp').each do |test_manifest|
puts "Applying test manifest #{test_manifest}"
success = system('bundle', 'exec', 'puppet', 'apply', '--verbose', '--noop', '--detailed-exitcodes', test_manifest)
raise 'Test manifest failed' unless success
end
end
desc "Build package"
task :build do
success = system('bundle', 'exec', 'puppet', 'module', 'build', '.')
raise 'Build failed' unless success
end
desc "Run acceptance tests"
task :acceptance_test do
success = system('bundle', 'exec', 'cucumber', '--strict')
raise 'Build failed' unless success
end
task :iis_object_properties do
require 'nokogiri'
['site', 'app', 'vdir', 'apppool', 'config', 'wp', 'request', 'module', 'backup', 'trace'].each do |iis_type|
puts ":#{iis_type}"
command_line = "\"#{File.join(ENV["SystemRoot"], "system32/inetsrv/appcmd.exe")}\" list #{iis_type} /xml /config:*"
xml_text = `#{command_line}`
xml = Nokogiri::XML(xml_text)
xml.xpath("/appcmd/#{iis_type.upcase}[1]/descendant::*").each do |element|
element.attributes.each_key do |key|
key = "#{element.path}/#{key}".gsub(/\/appcmd\/[^\/]+\/([^\/]+\/)?/, "").gsub("/", "_").downcase
puts " :#{key},"
end
end
puts ""
end
end