kondate 0.4.3 → 0.4.4

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: d31589ca629f60bafbae2b69c18b2624727f61bf
4
- data.tar.gz: bf1aab50985881df2d3992a52450f5c7b1bbd2c7
3
+ metadata.gz: 54deb24b15782ee8fbbba818d19c6d493d0a5b2e
4
+ data.tar.gz: 492519e0f1d06fc38af99e5e576a4c7ded06451b
5
5
  SHA512:
6
- metadata.gz: ede72933e1fe30fa55497986daaaa849e8e0afc1c67ae78ebc267595b441fb02f129b874752303eac3d490f66cabc6ce9ee366f8294ac4968326ce1fda82adb8
7
- data.tar.gz: 7c0ae9c00177ec96fb7fe967d56d90106163b29ede13caf2b8af9ece4726df90eac0a02f933ce662661afc097533a0c6571bd74f91399958edb5697db3573adb
6
+ metadata.gz: c3f87cc6ccf660587da86c2ef04b724623251cb0a6c3ddbf1d56106923609a2ea11c8419fa56e74dbe50b8112147236be93fd8f1a83600300d9d8d976d46d4ba
7
+ data.tar.gz: 6efaf410472520861cfe17e234e1d3ece626594ed4ba80fd6469c9afaaa1176d0405b2b2efb23d11aca2bd24899368b1bf0a637bf5fc42eec1d3eeba832407ba
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.4.4 (2016-12-02)
2
+
3
+ Changes:
4
+
5
+ * Prepare `Kondate::ItamaeBootstrap.bootstrap(context)`. Now, bootstrap.rb should just call it.
6
+
1
7
  # 0.4.3 (2016-12-02)
2
8
 
3
9
  Fixes:
data/README.md CHANGED
@@ -85,7 +85,8 @@ $ bundle exec kondate serverspec-role <role>
85
85
  │   │   └── roles
86
86
  │   └── spec
87
87
  │   ├── middleware
88
- │   └── roles```
88
+ │   └── roles
89
+ ```
89
90
 
90
91
  ### .kondate.conf
91
92
 
@@ -0,0 +1,48 @@
1
+ module Kondate
2
+ class ItamaeBootstrap
3
+ # @param [Itamae::Recipe::EvalContext] context itamae context
4
+ def self.bootstrap(context)
5
+ self.new(context).bootstrap
6
+ end
7
+
8
+ # @param [Itamae::Recipe::EvalContext] context itamae context
9
+ def initialize(context)
10
+ @context = context
11
+ end
12
+
13
+ def bootstrap
14
+ bootstrap_middleware_recipes
15
+ bootstrap_role_recipes
16
+ end
17
+
18
+ private
19
+
20
+ def node
21
+ @context.node
22
+ end
23
+
24
+ def include_recipe(recipe)
25
+ @context.include_recipe(recipe)
26
+ end
27
+
28
+ def bootstrap_middleware_recipes
29
+ recipes = node['attributes'].keys
30
+ recipes.each do |recipe|
31
+ secret_recipe_file = File.join(Config.secret_middleware_recipes_dir, recipe, "default.rb")
32
+ recipe_file = File.join(Config.middleware_recipes_dir, recipe, "default.rb")
33
+ File.exist?(secret_recipe_file) ? include_recipe(secret_recipe_file) : include_recipe(recipe_file)
34
+ end
35
+ end
36
+
37
+ def bootstrap_role_recipes
38
+ sep = File::SEPARATOR
39
+ secret_role_recipe_file = RoleFile.explore(Config.secret_roles_recipes_dir, node[:role], "#{sep}default.rb")
40
+ role_recipe_file = RoleFile.explore(Config.roles_recipes_dir, node[:role], "#{sep}default.rb")
41
+ if File.exist?(secret_role_recipe_file)
42
+ include_recipe(secret_role_recipe_file)
43
+ elsif File.exist?(role_recipe_file)
44
+ include_recipe(role_recipe_file)
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,17 +1,3 @@
1
- require 'yaml'
2
1
  require 'kondate'
3
2
 
4
- recipes = node['attributes'].keys
5
- recipes.each do |recipe|
6
- secret_recipe_file = File.join(Kondate::Config.secret_middleware_recipes_dir, recipe, "default.rb")
7
- recipe_file = File.join(Kondate::Config.middleware_recipes_dir, recipe, "default.rb")
8
- File.exist?(secret_recipe_file) ? include_recipe(secret_recipe_file) : include_recipe(recipe_file)
9
- end
10
- sep = File::SEPARATOR
11
- secret_role_recipe_file = Kondate::RoleFile.explore(Kondate::Config.secret_roles_recipes_dir, node[:role], "#{sep}default.rb")
12
- role_recipe_file = Kondate::RoleFile.explore(Kondate::Config.roles_recipes_dir, node[:role], "#{sep}default.rb")
13
- if File.exist?(secret_role_recipe_file)
14
- include_recipe(secret_role_recipe_file)
15
- elsif File.exist?(role_recipe_file)
16
- include_recipe(role_recipe_file)
17
- end
3
+ Kondate::ItamaeBootstrap.bootstrap(self)
@@ -1,3 +1,3 @@
1
1
  module Kondate
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
data/lib/kondate.rb CHANGED
@@ -11,3 +11,4 @@ require "kondate/hash_ext"
11
11
  require "kondate/string_util"
12
12
  require "kondate/error"
13
13
  require "kondate/host_plugin/base"
14
+ require "kondate/itamae_bootstrap"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kondate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - sonots
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-01 00:00:00.000000000 Z
11
+ date: 2016-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: itamae
@@ -176,6 +176,7 @@ files:
176
176
  - lib/kondate/hash_ext.rb
177
177
  - lib/kondate/host_plugin/base.rb
178
178
  - lib/kondate/host_plugin/file.rb
179
+ - lib/kondate/itamae_bootstrap.rb
179
180
  - lib/kondate/property_builder.rb
180
181
  - lib/kondate/property_file.rb
181
182
  - lib/kondate/role_file.rb