kitchen-itamae 0.0.1 → 0.0.2

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: ff41b885639874f9de1bf755c4e2417ca3f364f1
4
- data.tar.gz: e5db73512b7b6cb172087d1993cce40e32da7078
3
+ metadata.gz: c070b39d328e44d4c108ca00bc996616fc5c238c
4
+ data.tar.gz: f4e708ecdd2f708af9045e7a2b8160ae42264462
5
5
  SHA512:
6
- metadata.gz: 8898ce7d956899250ca18df8b34f62745a01e3641a3c63e0a86ed984ee37fcce8875f99149e7ccdc1022790a43e63a0548c34e835a53d531d0337da78ad8cdfb
7
- data.tar.gz: bdceff016c4dafd7f35c1e0649e7179f8e8467b1d9662c7b5c9dd39e656624758146c9eb135c9e97922d66b29ef0dad3d98beb9248df98fc9c4a3b790cd0d4d2
6
+ metadata.gz: 8868091d0b8f06b3665041ac5e311974f78401ef4e305e2d1a7a28605ecd9122a5226c80c732337458a93eed52102acfb904139419099bf63195a71c82dd81b9
7
+ data.tar.gz: 35b92412fade8396a8dde69a4a4f47c5008c0ee9abe2e850600ca15b0e0037458bb652cd84cbcf381d5d599741a9be23b1029a8bbdde8b124282dd7a261a04ee
data/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ CHANGELOG of Itamae::Kitchen
2
+
3
+ ## 0.0.2
4
+
5
+ - cleanup code
6
+ - cleanup sandbox
7
+ - cleanup remote root_path before converge
8
+ - option with_ohai
9
+ - option sudo_command
10
+ - option itamae_option
11
+ - plugin install by embedded gem (every run)
12
+
13
+ ## 0.0.1
14
+
15
+ - Initial release
16
+ - simple comverge
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Kitchen::Itamae
2
2
 
3
- TODO: Write a gem description
3
+ itamae provisioner for test-kitchen
4
+
4
5
 
5
6
  ## Installation
6
7
 
@@ -20,7 +21,7 @@ Or install it yourself as:
20
21
 
21
22
  ## Usage
22
23
 
23
- TODO: Write usage instructions here
24
+ https://github.com/OpsRockin/kitchen-itamae_playground
24
25
 
25
26
  ## Contributing
26
27
 
@@ -10,33 +10,52 @@ module Kitchen
10
10
  default_config :parasite_chef_omnibus, true
11
11
  default_config :chef_omnibus_url, "https://www.chef.io/chef/install.sh"
12
12
  default_config :chef_omnibus_root, "/opt/chef"
13
+ default_config :chef_omnibus_bin_dir, "/opt/chef/embedded/bin"
13
14
  default_config :chef_omnibus_install_options, nil
14
15
 
15
16
  default_config :itamae_root, "kitchen"
16
17
  default_config :recipe_list, []
17
18
  default_config :node_json, nil
19
+ default_config :with_ohai, false
20
+ default_config :itamae_option, nil
21
+ default_config :itamae_plugins, []
22
+
23
+ def initialize(config = {})
24
+ debug(JSON.pretty_generate(config))
25
+ init_config(config)
26
+ end
18
27
 
19
28
  # (see Base#create_sandbox)
20
29
  def create_sandbox
21
30
  super
22
- # prepare_data
23
- # prepare_script
24
31
  FileUtils.cp_r(Dir.glob("kitchen/*"), sandbox_path)
25
32
  end
26
33
 
27
- def cleanup_sandbox
28
- nil
34
+ # (see Base#init_command)
35
+ def init_command
36
+ cmd = []
37
+ cmd << "#{sudo("rm")} -rf #{config[:root_path]} ; mkdir -p #{config[:root_path]}"
38
+ debug("Cleanup Kitchen Root")
39
+ config[:itamae_plugins].map do |plugin|
40
+ cmd << "#{sudo(File.join(config[:chef_omnibus_bin_dir], "gem"))} install itamae-plugin-recipe-#{plugin} --no-ri --no-rdoc"
41
+ end
42
+ Util.wrap_command(cmd.join("\n"))
29
43
  end
30
44
 
31
45
  # (see Base#run_command)
32
46
  def run_command
33
- runlist = config[:config][:recipe_list].map do |recipe|
34
- cmd = ["cd #{config[:root_path]};", "sudo" , 'itamae']
47
+ debug(instance.inspect)
48
+ debug(JSON.pretty_generate(config))
49
+ runlist = config[:recipe_list].map do |recipe|
50
+ cmd = ["cd #{config[:root_path]};", sudo('itamae')]
35
51
  cmd << 'local'
36
- cmd << "-j #{config[:config][:node_json]}" if config[:config][:node_json]
52
+ cmd << '--ohai' if config[:with_ohai]
53
+ cmd << config[:itamae_option]
54
+ cmd << "-j #{config[:node_json]}" if config[:node_json]
37
55
  cmd << recipe
38
56
  cmd.join(" ")
39
57
  end
58
+ debug(runlist.join("\n"))
40
59
  Util.wrap_command(runlist.join("\n"))
41
60
  end
42
61
 
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Itamae
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sawanoboly
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - CHANGELOG.md
63
64
  - Gemfile
64
65
  - LICENSE.txt
65
66
  - README.md