itamae-mitsurin 0.30 → 0.31

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3bdbeb9c14d9b9704d024592551b28f18d97fff
4
- data.tar.gz: e4270bb192f74c0d3cc11f7e21fe42914f7efbdb
3
+ metadata.gz: 9cabd4bff1bf1171114080ecc87ce37999176a17
4
+ data.tar.gz: 1677861e63a3f990a1f30317236276b0ebfacacc
5
5
  SHA512:
6
- metadata.gz: 524feafa71849c6fa4da4536e990cfc1073f2e93a200a283732b3aa58f9d5e3bb94560e987ab20c2f70fd5beebe706f231c6d985420da1484b42b4bafff72584
7
- data.tar.gz: 6586a8ac771737afff31fc620cca7550d10b33febc738607da56b456af33f3ddd9bf3d765355dbe7bd6a3fb2dd5e287c5e7d0a8ebcad11f5d80de661be191d95
6
+ metadata.gz: e133205f06c4f296d3c446d27ad283afef51cb057248ceafc474ad15d7daf55aac685ce5fc9ed1ade427ff6d7650264bedfa7b093e764e6e18c3c487f7438d26
7
+ data.tar.gz: 5751195c1c45e2767eb191c8873735c35a41d264a936890c8e52ecdc1b62e9fdd0173c4b02e3a5112a320ad92ae7cb0ba105e3ba24b7adc2dfcc74f56c9adb3b
@@ -13,7 +13,7 @@ module ItamaeMitsurin
13
13
  node_h = JSON.parse(File.read(node_file), symbolize_names: true)
14
14
  rescue JSON::ParserError => e
15
15
  puts e.class.to_s + ", " + e.backtrace[0].to_s
16
- puts "nodefile error, nodefile:#{node_file}, reason:#{e.message}"
16
+ puts "Node load error, nodefile:#{node_file}, reason:#{e.message}"
17
17
  end
18
18
 
19
19
  desc "Itamae to #{bname}"
@@ -28,7 +28,7 @@ module ItamaeMitsurin
28
28
  end
29
29
  rescue Exception => e
30
30
  puts e.class.to_s + ", " + e.backtrace[0].to_s
31
- puts "nodefile or role error, nodefile:#{node_file}, reason:#{e.message}"
31
+ puts "Node or role error, nodefile:#{node_file}, reason:#{e.message}"
32
32
  else
33
33
  recipes.flatten!
34
34
  end
@@ -40,7 +40,7 @@ module ItamaeMitsurin
40
40
  env_h = JSON.parse(File.read("environments/#{env_set}.json"), symbolize_names: true)
41
41
  rescue Exception => e
42
42
  puts e.class.to_s + ", " + e.backtrace[0].to_s
43
- puts "nodefile or environments error, nodefile:#{node_file}, reason:#{e.message}"
43
+ puts "Node or environment load error, nodefile:#{node_file}, reason:#{e.message}"
44
44
  end
45
45
 
46
46
  # get recipes attr
@@ -107,11 +107,15 @@ module ItamaeMitsurin
107
107
  command << " -l debug" if ENV['debug'] == "true"
108
108
  command << " -c logs/config/itamae_task.config"
109
109
 
110
- # recipe load to_command
110
+ # recipes load to_command
111
111
  command_recipe = []
112
112
  recipes.each do |recipe_h|
113
- command_recipe <<
114
- " #{Dir.glob("site-cookbooks/**/#{recipe_h.keys.join}/recipes/#{recipe_h["#{recipe_h.keys.join}"]}.rb").join("\s")}"
113
+ target_recipe = "site-cookbooks/**/#{recipe_h.keys.join}/recipes/#{recipe_h["#{recipe_h.keys.join}"]}.rb"
114
+ unless File.exists?("#{Dir.glob(target_recipe).join}")
115
+ ex_recipe = recipe_h.to_s.gsub('=>', '::').gsub('"', '')
116
+ raise "Recipe load error, nodefile:#{node_file}, reason:Not exist the recipe #{ex_recipe}"
117
+ end
118
+ command_recipe << " #{Dir.glob(target_recipe).join("\s")}"
115
119
  end
116
120
 
117
121
  command_recipe.sort_by! {|item| File.dirname(item)}
@@ -126,6 +130,7 @@ module ItamaeMitsurin
126
130
  run_list_noti << c_recipe.split("/")[2]
127
131
  end
128
132
  }
133
+
129
134
  puts TaskBase.hl.color(%!Run List to \"#{run_list_noti.uniq.join(", ")}\"!, :green)
130
135
  puts TaskBase.hl.color(%!#{command}!, :white)
131
136
  st = system command
@@ -30,7 +30,7 @@ module ItamaeMitsurin
30
30
  node_h = JSON.parse(File.read(node_file), symbolize_names: true)
31
31
  rescue JSON::ParserError => e
32
32
  puts e.class.to_s + ", " + e.backtrace[0].to_s
33
- puts "nodefile error, nodefile:#{node_file}, reason:#{e.message}"
33
+ puts "Node error, nodefile:#{node_file}, reason:#{e.message}"
34
34
  end
35
35
 
36
36
  desc "Itamae to #{bname}"
@@ -45,7 +45,7 @@ module ItamaeMitsurin
45
45
  end
46
46
  rescue Exception => e
47
47
  puts e.class.to_s + ", " + e.backtrace[0].to_s
48
- puts "nodefile or role error, nodefile:#{node_file}, reason:#{e.message}"
48
+ puts "Node or role error, nodefile:#{node_file}, reason:#{e.message}"
49
49
  else
50
50
  recipes.flatten!
51
51
  end
@@ -57,7 +57,7 @@ module ItamaeMitsurin
57
57
  env_h = JSON.parse(File.read("environments/#{env_set}.json"), symbolize_names: true)
58
58
  rescue Exception => e
59
59
  puts e.class.to_s + ", " + e.backtrace[0].to_s
60
- puts "nodefile or environments error, nodefile:#{node_file}, reason:#{e.message}"
60
+ puts "Node or environment error, nodefile:#{node_file}, reason:#{e.message}"
61
61
  end
62
62
 
63
63
  # get recipes attr
@@ -127,8 +127,12 @@ module ItamaeMitsurin
127
127
  # recipe load to_command
128
128
  command_recipe = []
129
129
  recipes.each do |recipe_h|
130
- command_recipe <<
131
- " #{Dir.glob("site-cookbooks/**/#{recipe_h.keys.join}/recipes/#{recipe_h["#{recipe_h.keys.join}"]}.rb").join("\s")}"
130
+ target_recipe = "site-cookbooks/**/#{recipe_h.keys.join}/recipes/#{recipe_h["#{recipe_h.keys.join}"]}.rb"
131
+ unless File.exists?("#{Dir.glob(target_recipe).join}")
132
+ ex_recipe = recipe_h.to_s.gsub('=>', '::').gsub('"', '')
133
+ raise "Recipe load error, nodefile:#{node_file}, reason:Not exist the recipe #{ex_recipe}"
134
+ end
135
+ command_recipe << " #{Dir.glob(target_recipe).join("\s")}"
132
136
  end
133
137
 
134
138
  command_recipe.sort_by! {|item| File.dirname(item)}
@@ -15,7 +15,7 @@ module ItamaeMitsurin
15
15
  node_h = JSON.parse(File.read(node_file), symbolize_names: true)
16
16
  rescue JSON::ParserError => e
17
17
  puts e.class.to_s + ", " + e.backtrace[0].to_s
18
- puts "nodefile error, nodefile:#{node_file}, reason:#{e.message}"
18
+ puts "Node error, nodefile:#{node_file}, reason:#{e.message}"
19
19
  else
20
20
  all << node_h[:environments][:hostname].split(".")[0]
21
21
  task :all => all
@@ -33,7 +33,7 @@ module ItamaeMitsurin
33
33
  end
34
34
  rescue Exception => e
35
35
  puts e.class.to_s + ", " + e.backtrace[0].to_s
36
- puts "nodefile or role error, nodefile:#{node_file}, reason:#{e.message}"
36
+ puts "Node or role error, nodefile:#{node_file}, reason:#{e.message}"
37
37
  else
38
38
  recipes.flatten!
39
39
  end
@@ -45,7 +45,7 @@ module ItamaeMitsurin
45
45
  env_h = JSON.parse(File.read("environments/#{env_set}.json"), symbolize_names: true)
46
46
  rescue Exception => e
47
47
  puts e.class.to_s + ", " + e.backtrace[0].to_s
48
- puts "nodefile or environments error, nodefile:#{node_file}, reason:#{e.message}"
48
+ puts "Node or environment error, nodefile:#{node_file}, reason:#{e.message}"
49
49
  end
50
50
 
51
51
  # get recipes attr
@@ -105,8 +105,12 @@ module ItamaeMitsurin
105
105
  # recipe load to_command
106
106
  command_recipe = []
107
107
  recipes.each do |recipe_h|
108
- command_recipe <<
109
- " #{Dir.glob("site-cookbooks/**/#{recipe_h.keys.join}/recipes/#{recipe_h["#{recipe_h.keys.join}"]}.rb").join("\s")}"
108
+ target_recipe = "site-cookbooks/**/#{recipe_h.keys.join}/recipes/#{recipe_h["#{recipe_h.keys.join}"]}.rb"
109
+ unless File.exists?("#{Dir.glob(target_recipe).join}")
110
+ ex_recipe = recipe_h.to_s.gsub('=>', '::').gsub('"', '')
111
+ raise "Recipe load error, nodefile:#{node_file}, reason:Not exist the recipe #{ex_recipe}"
112
+ end
113
+ command_recipe << " #{Dir.glob(target_recipe).join("\s")}"
110
114
  end
111
115
 
112
116
  command_recipe.sort_by! {|item| File.dirname(item)}
@@ -121,12 +125,13 @@ module ItamaeMitsurin
121
125
  run_list_noti << c_recipe.split("/")[2]
122
126
  end
123
127
  }
128
+
124
129
  puts TaskBase.hl.color(%!Run List to \"#{run_list_noti.uniq.join(", ")}\"!, :green)
125
130
  puts TaskBase.hl.color(%!#{command}!, :white)
126
131
  begin
127
132
  st = system command
128
133
  rescue Exception => e
129
- puts "command error, nodefile:#{node_file}, reason:#{e.message}"
134
+ puts "Command error, nodefile:#{node_file}, reason:#{e.message}"
130
135
  puts "#{e.backtrace}"
131
136
  ensure
132
137
  FileUtils.remove_entry_secure path
@@ -16,7 +16,7 @@ module Itamae
16
16
  node_attr = JSON.parse(File.read(node_file), symbolize_names: true)
17
17
  rescue JSON::ParserError => e
18
18
  puts e.class.to_s + ", " + e.backtrace[0].to_s
19
- puts "nodefile error, nodefile:#{node_file}, reason:#{e.message}"
19
+ puts "Node error, nodefile:#{node_file}, reason:#{e.message}"
20
20
  end
21
21
 
22
22
  node_short = node_attr[:environments][:hostname].split(".")[0]
@@ -37,7 +37,7 @@ module Itamae
37
37
  end
38
38
  rescue Exception => e
39
39
  puts e.class.to_s + ", " + e.backtrace[0].to_s
40
- puts "nodefile or role error, nodefile:#{node_file} reason:#{e.message}"
40
+ puts "Node or role error, nodefile:#{node_file} reason:#{e.message}"
41
41
  exit 1
42
42
  else
43
43
  recipes << {'_base' => 'default'}
@@ -65,8 +65,12 @@ module Itamae
65
65
  # recipe load to_spec
66
66
  spec_pattern = []
67
67
  recipes.each do |spec_h|
68
- spec_pattern <<
69
- " #{Dir.glob("site-cookbooks/**/#{spec_h.keys.join}/spec/#{spec_h["#{spec_h.keys.join}"]}_spec.rb").join("\s")}"
68
+ target_spec = "site-cookbooks/**/#{spec_h.keys.join}/spec/#{spec_h["#{spec_h.keys.join}"]}_spec.rb"
69
+ unless File.exists?("#{Dir.glob(target_spec).join}")
70
+ ex_recipe = spec_h.to_s.gsub('=>', '::').gsub('"', '')
71
+ raise "Spec load error, nodefile:#{node_file}, reason:Not exist the spec #{ex_recipe}"
72
+ end
73
+ spec_pattern << " #{Dir.glob(target_spec).join("\s")}"
70
74
  end
71
75
 
72
76
  spec_pattern.sort_by! {|item| File.dirname(item)}
@@ -79,6 +83,7 @@ module Itamae
79
83
  run_list_noti << c_spec.split("/")[2]
80
84
  end
81
85
  }
86
+
82
87
  puts TaskBase.hl.color(%!Run Serverspec to \"#{node_name}\"!, :red)
83
88
  puts TaskBase.hl.color(%!Run List to \"#{run_list_noti.uniq.join(", ")}\"!, :green)
84
89
  st = system specs
@@ -1 +1 @@
1
- 0.30
1
+ 0.31
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-mitsurin
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.30'
4
+ version: '0.31'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akihiro Kamiyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-19 00:00:00.000000000 Z
11
+ date: 2016-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor